Hey Everyone,
I need some help for setting up correctly OneSignal Push Notification in Ionic 2. I follow all the instructions step by step but it still fails. (Sorry for my english guys), No user are subscribed. And i’m always getting this error when i run my project:
“Error: Uncaught (in promise): TypeError: Cannot read property ‘OneSignal’ of undefined
TypeError: Cannot read property ‘OneSignal’ of undefined
at main.js:99116
at t.invoke (polyfills.js:3)
at Object.onInvoke (main.js:35839)
at t.invoke (polyfills.js:3)
at e.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (main.js:35830)
at t.invokeTask (polyfills.js:3)
at e.runTask (polyfills.js:3)
at s (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (main.js:35830)
at t.invokeTask (polyfills.js:3)
at e.runTask (polyfills.js:3)
at i (polyfills.js:3)
at HTMLDocument.invoke (polyfills.js:3)
ErrorHandler.handleError @ main.js:51872”
So the code i typed in my app.component.ts is :
and in my credentials.ts file where i put my api_key :
That’s all!! Please, i really need help i struggle with this issue for a long time but i didn’t find any solution