Firebase - Swift 4: Message Sent But Not Received

Firebase Cloud Messaging notification not received on iOS

It turned out, only messages that do not contain a notification object are delivered if your app hasn't yet been approved to the App Store.

After having the first version out, push notifications work for your app, even in debug mode.

Firebase push notification is not received on the iOS device. Although console logs the message, it is received on device

There are two ways to receive notification:

  1. when the app is closed/inactive and you get the payload in didFinishLaunchingWithOptions:

  2. when the application is open/active and currently visible you get payload in didReceiveRemoteNotification:

When your application is closed, iOS take care of displaying a notification (if notification extension not developed) and launch your app when you tap on it.

If your application is open you have to take care of displaying this notification or ignore it.

Here what official documentation says:

When local and remote notifications are not handled directly by your
app or the user, they are displayed in Notification Center so that
they can be viewed later. Use the
getDeliveredNotificationsWithCompletionHandler: method of the shared UNUserNotificationCenter object to get a list of
notifications still being displayed in Notification Center. If you
find any notifications that are now outdated and should not be
displayed to the user, you can remove them using the
removeDeliveredNotificationsWithIdentifiers: method.

official documentation

Firebase notifications received on iOS 12 but not received on iOS 13

It looked like there is an issue in Firebase - APNS integration using the auth key method (at least for my case with the bellow information)

The test made on XCode version 11.4, iOS 12.4.2, 13.4 and 13.4.1

There is an issue in Firebase push notifications when using the auth key and should use the p12 certificates instead

I checked direct APNS push notifications (without firebase) it's working fine

I checked also using 2 methods APNS auth key and p12 certificates, it worked on p12 certificates but not for auth key



Related Topics



Leave a reply



Submit