Bob-Touchwonders
Bob-Touchwonders

Reputation: 1

Flutter Firebase Cloud Messaging Not Receiving Silent Data Messages on iOS

My team and I are running into an issue with Firebase Cloud Messaging. We are not receiving data messages when running the app in the foreground, background nor killed state.

We configured the following things:

Notification Messages work nicely. However, data messages do not trigger any of the FCM Message listeners. at least, not whilst Method Swizzling is enabled. When disabling Method Swizzling like this:

info.plist
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>

the data messages are received in the app. However, We do not want to disable method swizzling, as Firebase states that Flutter developers should not do this:

Flutter FCM Apple Integration

We are using the following FCM payload to test:

{
    "message": {
        "token": "{FCM_TOKEN_HERE}",
        "data": {
            "type": "TEST"
        },
        "apns": {
            "payload": {
                "aps": {
                    "content-available": 1
                }
            },
            "headers": {
                "apns-priority": "5"
            }
        }
    }
}

EDIT: The app is using Firebase Messaging 14.8.1

See the details above.

Upvotes: 0

Views: 41

Answers (1)

Bob-Touchwonders
Bob-Touchwonders

Reputation: 1

I've already found the issue myself. It seems that in the past my team chose to use the dart-only initialization of FlutterFire. This, in our case, broke the Firebase Silent Data Messages because the GoogleService-info.plist files were missing.

Reconfiguring FlutterFire (manually) and adding the GoogleService-info.plist solved the problem.

Upvotes: 0

Related Questions