且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

FCM for android:当应用程序在后台时弹出系统通知

更新时间:2022-12-27 10:37:39

当您的应用程序在后台使用 data 时,只能处理 onMessageReceived 中的消息> 只有有效载荷.

It is only possible to handle the message in onMessageReceived when your app is in background when using a data only payload.

在您的负载中同时使用 notificationdata 时,预期的行为是 Android 系统将在应用程序处于后台时处理通知,无论是什么priority 的价值.

When using both notification and data in your payload, the expected behavior is that the Android System will handle the notification when the app is in background, regardless of what is the value of your priority.

有关更多信息,请参阅关于处理 Android 消息的官方文档详情.

See the official docs on Handling Android Messages for more details.