简体   繁体   中英

FCM Notification iOS not working when app is in background or terminated

I saw this question multiple times but none of the answers worked for me.

applicationReceivedRemoteMessage gets called when app is in foreground.

I set content_available to true and priority high in my payload.

I set background modes in capabilities for remote notifications. Tried removing it still didn't work.

Implemented didRegisterForRemoteNotificationsWithDeviceToken and when I setAPNSToken for sandbox or unknown or prod I can't even receive the notifications when app is in foreground. If I don't set anything then I get notifications when app is in foreground but not in background or inactive.

The certificates I uploaded into fcm project are valid and configured properly.

Am I missing something? Thanks in advance.

FIRMessaging.messaging().disconnect()applicationDidEnterBackground程序委托的applicationDidEnterBackground方法内部尝试此操作,这对我FIRMessaging.messaging().disconnect()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM