简体   繁体   English

当应用程序未运行收到通知时,我想处理消息

[英]I want to handle message when notification received with app not running

In Android APP, I have already use FCM to receive Cloud Message, when the app is foreground , the MyFirebaseMessageService.java (I defined) runned. 在Android APP中,我已经使用FCM接收Cloud Message,而当应用程序为前台时,运行了MyFirebaseMessageService.java (我定义)。 However when the app is background or not running ,The MyFirebaseMessageService.java doesn't run, I can also receive notification, when I click the notification, Where can I get the cloud message? 但是,当应用程序处于后台运行或未运行时, MyFirebaseMessageService.java无法运行,我还可以收到通知,当我单击通知时,在哪里可以获取云消息?

Send your push as data and not as notification, and it will be received always in MyFirebaseMessageService onMessageReceived. 将推送作为数据而不是作为通知发送,它将始终在MyFirebaseMessageService onMessageReceived中接收。

https://firebase.google.com/docs/cloud-messaging/concept-options https://firebase.google.com/docs/cloud-messaging/concept-options

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

相关问题 应用未运行时未收到GCM通知 - GCM notification is not received when App is not running 在应用程序运行时处理推送通知 - Handle push notification when app is Running 收到推送通知后恢复应用时的处理方式 - How to handle case when app is resumed after push notification was received 我希望我的应用程序在收到消息时在后台运行。 我该如何编程? - I want my app to run in background when a message is received. How do i program it? 我杀死应用程序后未收到Firebase推送通知? - Firebase Push notification is not Received when i kill the app? 当收到消息,甚至是单击消息的泛白时,火基推送通知将启动应用程序 - Fire-base push notification starts the app when message received even whiteout clicking the message 我想显示通知,即使我的Android应用正在运行 - I want to show notification even if my Android app is running 从Mixpanel收到消息时发出声音通知 - sound notification when message received from mixpanel 使用 Firebase 的聊天应用程序:收到新消息时收到通知 - Android - Chat App using Firebase: Get notification when new message received - Android 当我单击通知时,我想继续应用程序,而不是启动意图 - when I clicked notification I want to continue app , not start an intent
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM