quickstart-ios
quickstart-ios copied to clipboard
Does FCM Messaging for IOS works with Data Messages (app in background)?
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!