使用 ostownsville/cordova-plugin-fcm,onNotification() 方法无法在 an



我在从服务器端发送的消息中click_Action:"FCM_PLUGIN_ACTIVITY"onNotification()该方法仍未在Android上执行。我在设备上收到推送通知,但它不会进入onNotification()。它在ios上工作正常。

以下是我的应用程序中的科尔多瓦版本。

"dependencies": {
"cordova-android": "^6.2.3",
"cordova-google-api-version": "0.0.1",
"cordova-ios": "^4.5.0",
"cordova-plugin-fcm": "git+https://github.com/ostownsville/cordova-plugin-fcm.git",
"cordova-plugin-geolocation": "2.1.0",
"cordova-plugin-inappbrowser": "1.2.0",
"cordova-plugin-network-information": "1.2.1",
"cordova-plugin-screen-orientation": "~2.0.2",
"cordova-plugin-splashscreen": "3.2.2",
"cordova-plugin-streaming-media": "^1.0.2",
"cordova-plugin-whitelist": "1"
}

我已经尝试了所有可能的解决方案来解决这个问题。有人可以帮我解决这个问题吗?

我遇到了完全相同的问题,无论我做什么,onNotification((都不会触发。我最终使用了离子原生推送,它使用了 cordova 的推送插件,并且效果很好。下面是我所做的事情的片段 const options: PushOptions = { android: { senderID: '??????' }, ios: { alert: 'true', badge: false, sound: 'true' } }; const pushObject: PushObject = this.push.init(options); pushObject.on('registration').subscribe((data: any) => { console.log('device token -> ' + data.registrationId); });
pushObject.on('notification').subscribe((data: any) => { console.log('message -> ' + data.message); }); pushObject.on('error').subscribe(error => console.error('Error with Push plugin' + error));

相关内容

最新更新