【发布时间】:2020-07-02 18:39:06
【问题描述】:
来自谷歌文档:
在后台应用中处理通知消息
当您的应用处于后台时,Android 会将通知消息定向到系统托盘。默认情况下,用户点击通知会打开应用启动器。
但我需要处理点击并转发到我的应用上的特定活动(当应用在后台时)。
class CustomFirebaseMessagingService : FirebaseMessagingService() {
/*-
Call this method only when app is foreground.
*/
override fun onMessageReceived(remoteMessage: RemoteMessage?) {
只有当应用在前台时才调用 onMessageReceived 方法。
【问题讨论】:
-
你的代码在哪里?你试过什么?
标签: android firebase-cloud-messaging