quickstart-ios icon indicating copy to clipboard operation
quickstart-ios copied to clipboard

Does FCM Messaging for IOS works with Data Messages (app in background)?

Open flutter2k20 opened this issue 5 years ago • 0 comments

Hi There,

I have an IOS app setup to receive FCM push messages. I can receive "notification" messages fine - always shows a notification with the title/body etc.

Now I am trying to send data messages to the app and expecting the

override func application(_ application: UIApplication,
                              didReceiveRemoteNotification userInfo: [AnyHashable : Any],
                              fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void

to be called with the data received. And it never gets called even the app is in foreground. My message/payload looks like

{
  "to": "DEVICE_TOKEN",
  "content_available": true,
  "apns-priority": 5,
  "data": {
    "somekey": "somevalue"
  }
}

I have tried with method swizzling flag enabled or disabled and it does not makes any difference.

My question is, does firebase SDK for IOS support data messages at all?

Thanks!

flutter2k20 avatar Oct 18 '20 08:10 flutter2k20