简体   繁体   English

如何收到Android中收到的通知的回电?

[英]How do I get a call back for notification received in android?

Is it possible/is there a reliable way to get a call back when a notification is received on the android platform? 在Android平台上收到通知时,是否可以/是否有可靠的方法来回电? ie I want to record when the notification is received (not when it is later opened). 即我想记录何时收到通知(而不是以后打开时)。

No, It's your app which receives the message so if you need things logged, then log it. 不,这是您的应用程序收到的消息,因此,如果您需要记录所有内容,请对其进行记录。 Simply handle it as you like once you receive it. 收到后即可根据需要随意处理。 Note that if you use FCM with Notification message message type, then you will not be directly notified about message arrival when app is in background (notification will be automatically posted by Firebase - your app will get message payload once use taps the notification). 请注意,如果您将FCM与Notification message消息类型一起使用,则当应用程序在后台运行时,不会直接收到有关消息到达的通知(Firebase会自动发布通知-使用该通知时,您的应用程序将获得消息有效负载)。 In such case consider switching to Data messages so you will get it no matter your app is in foreground or not. 在这种情况下,请考虑切换到“ Data messages这样无论您的应用程序是否处于前台,您都将获得它。

See docs: https://firebase.google.com/docs/cloud-messaging/downstream 查看文件: https : //firebase.google.com/docs/cloud-messaging/downstream

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在收到通知且应用程序处于后台时调用 android 中的另一个活动 - How to call another activity in android when notification received and app is in background 在Android中获取通知的接收时间 - Get Notification received time in Android 在后台收到通知时,如何让我的android应用执行代码? - How can I get my android app to execute code when a notification is received when it's in background? 如何在 flutter 后台收到本地通知时调用 function - How can I call a function on local notification received in background in flutter 是否有可能从我们在android上创建的类中获取最新的未接来电或收到的短信通知? - Is it possible to get latest missed call or received sms notification from a class which we created on android? 如何在 android studio 中获取“自定义活动”菜单? - How do I get the "custimize the activity" menu back in android studio? 如何获取我从应用程序发出的呼叫的通话结束通知-Android - How to get a call ended notification for a call which i have placed from my application - Android 在Android中,如何获取给定通知ID的当前显示的通知? - In Android how do I get the currently displayed notification for a given notification id? 如何知道Android中是否未收到电话 - How to know if the call is not received in Android 如何停止GCMBaseIntentService以便不会收到通知? - How to stop GCMBaseIntentService so that notification will not get received?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM