Search code examples
ionic3cordova-pluginsonesignal

ionic 3 oneSignal.cancelNotification not working (Android Platform)


Having implemented and working properly ionic native oneSignal and cordova oneSignal (Ionic 3, Android platform), when trying to cancel an specific notification with

this.oneSignal.cancelNotification(data.androidNotificationId)

the console shows a warning:

vendor.js:67753 Native: tried calling OneSignal.cancelNotification, but the OneSignal plugin is not installed;

and

Install the OneSignal plugin: 'ionic cordova plugin add onesignal-cordova-plugin

It makes no sense since the plugin and notifications are working perfectly with the rest of methods, and this is the only method that doesn´t work.

Thanks


Solution

  • Requires Authentication Key

    Requires your OneSignal App's REST API Key, available in Keys & IDs, unless the notification was created using include_player_ids and targeting only one user.


    It is not implemented (in cordova). That's why it is not working.

    Ionic native has give you the functions to call, but at this time there is no cordova / native (android / iOS) implementation behind this.

    You need to do this from backend side.