【发布时间】:2020-10-28 04:06:29
【问题描述】:
在我的 ionic 3 应用程序中,我使用的是 cordova-plugin-fcm-with-dependecy-updated,除了 1 个案例外,一切正常。
如果应用程序被杀死并且点击通知时,onNotification() 不会被调用,但如果应用程序打开,它会被调用。
我检查了一些帖子,但没有一个对我有用:
- https://developer.aliyun.com/mirror/npm/package/cordova-plugin-fcm-with-dependecy-updated/v/7.0.0-beta.1
- fcm.onNotification() not getting called on clicking the notification when the app is in background
以前,我使用cordova-plugin-fcm-with-dependency-updated-apns,它运行良好,但由于 IOS 中的 UIWebView 弃用,我需要使用另一个选项。
这是我的服务器负载:
{
"to" : "FCM_Token",
"notification":{
"title":"Notification title",
"body":"Notification body",
"sound":"default",
"click_action":"FCM_PLUGIN_ACTIVITY"
},
"data":{
"param1":"w1",
"param2":"w1"
},
"priority":"high"
}
我正在使用cordova:10.0.0 / ionic:3.9.2 / cordova-ios:6.1.1 / cordova-android:9.0.0
如果应用程序被杀死,任何人都知道如何在单击它时调用 onNotification()。?
【问题讨论】:
标签: cordova ionic3 cordova-plugins cordova-plugin-fcm