In Ionic tried calling OneSignal.startInit, but the OneSignal plugin is not installed


#1

When i run app on device i get Error

Native: tried calling OneSignal.startInit, but the OneSignal plugin is not installed.
main.js:59277 Install the OneSignal plugin: 'ionic plugin add onesignal-cordova-plugin’
main.js:59271 Native: tried calling OneSignal.inFocusDisplaying, but the OneSignal plugin is not installed.
main.js:59277 Install the OneSignal plugin: 'ionic plugin add onesignal-cordova-plugin’
main.js:59271 Native: tried calling OneSignal.handleNotificationReceived, but the OneSignal plugin is not installed.
main.js:59277 Install the OneSignal plugin: ‘ionic plugin add onesignal-cordova-plugin’

main.js:80797 EXCEPTION: Uncaught (in promise): plugin_not_installedErrorHandler.handleError @ main.js:80797
main.js:80802 ORIGINAL STACKTRACE:ErrorHandler.handleError @ main.js:80802
main.js:80803 Error: Uncaught (in promise): plugin_not_installed
at new Error (native)

my system info is :

global packages:

@ionic/cli-utils : 1.1.2
Cordova CLI      : 7.0.1 
Ionic CLI        : 3.1.2

local packages:

@ionic/app-scripts              : 1.1.4
@ionic/cli-plugin-cordova       : 1.0.0-rc.2
@ionic/cli-plugin-ionic-angular : 1.0.0-rc.2
Ionic Framework                 : ionic-angular 2.2.0

System:

Node       : v7.10.0
OS         : Linux 4.4
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

i have also tried

onesignal-cordova-plugin-pgb-compat (this plugin generating error at time of platform add).

Please help me, Thanks


#2

So did you install the plugin?


#3

These three should be updated without any problems by the way.


#4

Thanks for reply, but i have tried this one


#5

And what was the result?

Are you testing on iOS or Android?
Did you try removing the platform ad re-add it again?


#6

i’m testing on both, many times i uninstalled platform and added platform, its giving an error
EXCEPTION: plugin_not_installed


#7

I’m getting the same error after build for iOS. I build, then install on my test iPad and the console reports:

Native: tried calling OneSignal.startInit, but the OneSignal plugin is not installed.
Install the OneSignal plugin: 'ionic plugin add onesignal-cordova-plugin'
TypeError: this.oneSignal.startInit('APPIDSANITIZED', 'GOOGLEPROJECTSANITIZED').endInit is not a function. (In 'this.oneSignal.startInit('APPIDSANITIZED', 'GOOGLEPROJECTSANITIZED').endInit()', 'this.oneSignal.startInit('APPIDSANITIZED', 'GOOGLEPROJECTSANITIZED').endInit' is undefined) — main.js:82860

(I pulled out my app ID and project number for security…)

Here’s ionic info:

global packages:

    @ionic/cli-plugin-proxy : 1.3.0
    @ionic/cli-utils        : 1.3.0
    Cordova CLI             : 7.0.1
    Ionic CLI               : 3.3.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.3.0
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Cordova Platforms               : android 6.2.3 ios 4.4.0
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v6.10.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002
    ios-deploy : 1.9.1
    ios-sim    : 5.0.13

The plugin works great on an Android build of the same project; device gets registered and I can receive push notifications.

I’ve uninstalled and reinstalled the plugin several times and removed/re-added the iOS platform to my project. All the plugin files are there, and like I mentioned, it builds fine for Android; not sure what to check for why iOS is reporting the plugin isn’t installed.


#8

@ionic/app-scripts”: “^1.3.7”,
"@ionic/cli-plugin-cordova": “1.0.0-rc.2”,
"@ionic/cli-plugin-ionic-angular": “1.0.0-rc.2”,
“typescript”: “2.0.9”

please update typscript.


#9

Thanks.

Done.

npm install -g typescript
/usr/local/bin/tsc -> /usr/local/lib/node_modules/typescript/bin/tsc
/usr/local/bin/tsserver -> /usr/local/lib/node_modules/typescript/bin/tsserver
/usr/local/lib
└── typescript@2.3.4

Removed and added iOS platform back to project, ran clean build, same result.

Native: tried calling OneSignal.startInit, but the OneSignal plugin is not installed.

#10

please remove platform, update @ionic/app-scripts, add platform and install your onesignal inside platform also


#11

I have the same issue and I am on the latest app scripts - 1.3.7. Removing and adding the platform back did not solve the problem. Anybody managed to find a solution?


#12

if using phonegap, is your plugin formatted like this in your project’s config.xml?
<gap:plugin name="onesignal-cordova-plugin" spec="^2.1.1" source="npm" />


#13

You have to have an apple developer account and an APNS Certificate through the Apple Dev Portal to use any plugins that access notifications (I think)


#14

Did you find out how to solve this issue?


#15

Hey i am facing same error!!! Did you find out solution of this problem??

Thanks in advance