简体   繁体   中英

Oreo (API 26) Notifications not received when app in background

I was having some difficulties in implementing the notifications for API 26 and above. The notification arrives when app is open but no notifications are received when the app is in background or closed.(I have included notification channels as per the documentation)

谢谢大家,我找到了解决方案,显然在使用api 26时,我使用的Firebase消息传递的最低版本是11.2.0,我正在使用10,2.0

Based on the documentation :

FCM attempts to deliver high priority messages immediately, allowing the FCM service to wake a sleeping device when necessary and to run some limited processing (including very limited network access). High priority messages generally should result in user interaction with your app. If FCM detects a pattern in which they don't, your messages may be de-prioritized

You need to ensure that user is interacting with app otherwise the Notification wont be delivered immediately in doze mode.

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