OneSignal is a push notification service for web and mobile apps. This SDK makes it easy to integrate your website with OneSignal Push Notifications. https://onesignal.com
Calling Onesignal.logout() shows error in console.
Error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getIdentityModel')
at on.<anonymous> (OneSignalSDK.page.es6.js?v=160203:1:220768)
at Generator.next (<anonymous>)
at OneSignalSDK.page.es6.js?v=160203:1:267888
at new Promise (<anonymous>)
at o (OneSignalSDK.page.es6.js?v=160203:1:267633)
at on.logout (OneSignalSDK.page.es6.js?v=160203:1:220711)
at sn.<anonymous> (OneSignalSDK.page.es6.js?v=160203:1:226285)
at Generator.next (<anonymous>)
at OneSignalSDK.page.es6.js?v=160203:1:267888
at new Promise (<anonymous>)
This shows the following line fails:
const e = sn.coreDirector.getIdentityModel();
I assume sn.coreDirector is undefined. Tracking this through the code a bit, it appears that coreDirector should be created when OneSignal.init(...) is called. In debugging, I added another init call to ensure it was invoked, and when I did I got an error saying init can only be run once, so I've confirmed init is being called before logout.
What happened?
Calling
Onesignal.logout()
shows error in console.Error:
This shows the following line fails:
const e = sn.coreDirector.getIdentityModel();
I assume
sn.coreDirector
is undefined. Tracking this through the code a bit, it appears thatcoreDirector
should be created whenOneSignal.init(...)
is called. In debugging, I added anotherinit
call to ensure it was invoked, and when I did I got an error saying init can only be run once, so I've confirmedinit
is being called beforelogout
.What browsers are you seeing the problem on?
Chrome (Chromium)
What operating system are you running?
macOS
Steps to reproduce?
In another section on page: