Firebase notifications trigger the wrong delegate on iOS 10

I use Firebaseto configure push notifications on iOS 10. My application receives deleted messages in the foreground, but not in the background. Background messages are only accepted when you open the application.

Somehow, all push notifications are received through the applicationReceivedRemoteMessage:Firebase data data delegate, but in fact I never send a data payload.

I definitely implemented AppDelegate, as indicated in the lesson on the Firebase website, I installed APNS tokens myself, and all the certificates are in the right place. In addition, my payload is sent with priority "high" and accessible content.

Has anyone understood why the native iOS 10 ( userNotificationCenter:willPresentNotification:withCompletionHandler:) remote message handler is no longer called?

Thank you so much! (Debugged this for two days right now ...)

+4
source share
2 answers

I ran into this problem.

I resolved it by adding the following text to the sender:

"notification":{"body":""}}

Do not install the Firebase delegate and just process it according to the old method

didReceiveRemoteNotification
0
source

take a look at the firebase swizzling method

FCM SDK swizzling : APN FCM . , swizzling , FirebaseAppDelegateProxyEnabled Info.plist NO ( ). , , swizzling.

0

Source: https://habr.com/ru/post/1656538/


All Articles