FCM:我已经使用FCM来接收我的应用程序的通知。当我的应用程序处于前台时,它会将所有通知分组,但不在应用程序处于后台时分组 [英] FCM: I have used FCM to receive notification for my app. When my app is in foreground it groups all notifications but not when app is in background

查看:271
本文介绍了FCM:我已经使用FCM来接收我的应用程序的通知。当我的应用程序处于前台时,它会将所有通知分组,但不在应用程序处于后台时分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在前台为我的应用分组通知。每当应用程序进入后台,它会创建多个通知。我该如何解决这个问题? 解决方案

正如谷歌在 site ,当应用程序在后台时,系统默认管理通知:


当您的应用在后台时传递的通知。在这个
的情况下,通知被传递到设备的系统托盘。
用户点击一个通知会打开应用程序启动程序默认情况下。


但是,如果您想要使用通知你自己你应该发送数据信息而不是通知,如这里所述,你可以处理通知。


I am able to group notifications for my app when it is in foreground. Whenever the app goes in background it creates multiple notification. How can I fix this?

解决方案

As google says in this site, when app is in background notifications are administrated by the system by default :

Notifications delivered when your app is in the background. In this case, the notification is delivered to the device’s system tray. A user tap on a notification opens the app launcher by default.

But if you want to work with the notifications by "yourself" you should send the 'data message' instead of the 'notification' as is said here and you can handle the notification.

这篇关于FCM:我已经使用FCM来接收我的应用程序的通知。当我的应用程序处于前台时,它会将所有通知分组,但不在应用程序处于后台时分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆