在没有用户点击通知的情况下处理数据有效载荷? [英] Handle the data payload without user tapping on the notification?

查看:74
本文介绍了在没有用户点击通知的情况下处理数据有效载荷?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在后台,应用程序会在通知托盘中接收通知有效载荷,并且仅在用户点击通知时处理数据有效载荷.

When in the background, apps receive the notification payload in the notification tray, and only handle the data payload when the user taps on the notification.

有什么方法可以处理数据有效载荷而无需用户点击通知?

Is there any way to handle the data payload without user tapping on the notification?

推荐答案

基于处理邮件:

App state   Notification        Data                Both
Foreground  onMessageReceived   onMessageReceived   onMessageReceived
Background  System tray         onMessageReceived   Notification: system tray
                                                    Data: in extras of the intent.

不是仅通过点击通知专门处理它.您可以在onMessageReceived()中处理它.可以肯定的是,点击操作还取决于您的实现方式.

It's not specifically handled ONLY by tapping on the Notification. You may handle it in the onMessageReceived(). Pretty sure the tap action also depends on how you implement it.

如果您打算让它做其他事情,请提供更多详细信息.

If you intend for it to do something else, do provide more details.

这篇关于在没有用户点击通知的情况下处理数据有效载荷?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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