capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

ionic 6 capacitor 3 onesignal 3.0.1 ERROR – "plugin_not_installed"

Open zubinraja opened this issue 4 years ago • 6 comments

Followed onesignal plugin documentation and OneSignal SDK documentation to implement push notification with onesignal. But while running app getting "plugin_not_installed" error as below. Documentations link: ionic: https://ionicframework.com/docs/native/onesignal onesignal: https://documentation.onesignal.com/docs/ionic-sdk-setup

Warning asks to install Cordova Plugin inside capacitor!

Screenshot of error Screen Shot 2022-02-08 at 11 28 52 PM

zubinraja avatar Feb 08 '22 18:02 zubinraja

This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.

Please see the Contributing Guide for how to create a Code Reproduction.

Thanks! Ionitron 💙

Ionitron avatar Feb 08 '22 18:02 Ionitron

Hello,

below is public git repo that demonstrates the error. https://github.com/zubinraja/CapacitorOnesignalTest

Thanks! Zubin

zubinraja avatar Feb 08 '22 18:02 zubinraja

The bug is in the @awesome-cordova-plugins/onesignal, not in Capacitor. The onesignal plugin did a major update back in August with a few breaking changes and the types have not been updated accordingly yet, but the error message is misleading. It was reported, but the issue was closed because of inactivity.

The plugin has its own types now, so you can probably use them instead of @awesome-cordova-plugins/onesignal, you can check their docs.

jcesarmobile avatar Feb 09 '22 13:02 jcesarmobile

I am adding below code in Angular/Ionic 6:

import OneSignal from "onesignal-cordova-plugin"; ... configurateInit() {

OneSignal.setAppId("xxxxxx-xxx-xxxxxx");

// get data when opening notification
OneSignal.setNotificationOpenedHandler((data) => {

});

// Prompts the user for notification permissions.
OneSignal.promptForPushNotificationsWithUserResponse(function(accepted) {
   
});

// set device data when loading app
OneSignal.getDeviceState((data) => {
 
});

}

markCornejo avatar Aug 28 '22 00:08 markCornejo

@markCornejo with the code you provided, building in xCode it gives me this error:

error

it shows this error for every function of oneSignal (setAppId aswell)

INARTECHSA avatar Sep 07 '22 11:09 INARTECHSA

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Nov 10 '22 18:11 ionitron-bot[bot]