You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I upgrade Onesignal in my Cordova project from v.3 to v.5 and following this guide: https://documentation.onesignal.com/docs/mobile-sdk. However, I get errors in console saying methods described in docs are not defined.
E.g. I try to use "window.plugins.OneSignal.Notifications.permission" to get permission state and get undefined. In console I see window.plugins.OneSignal.Notifications has _permission property (prefixed with underscore). Does it mean the plugin was initialized the wrong way? Or it is just not mentioned in docs?
Some other methods described in docs are not defined even with underscore, e.g. window.plugins.OneSignal.Notifications.addPermissionObserver.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
The method to access permission is let permission = OneSignal.Notifications.hasPermission(). We will update the docs at https://documentation.onesignal.com/docs/mobile-sdk to show the correct way to get permission.
This guide is the most updated and accurate list of methods and properties available for the OneSignal-Cordova-SDK.
As for your question about methods that are prefixed by an underscore (_), those are internal methods the SDK uses and not meant to be used by app developers.
How can we help?
I upgrade Onesignal in my Cordova project from v.3 to v.5 and following this guide: https://documentation.onesignal.com/docs/mobile-sdk. However, I get errors in console saying methods described in docs are not defined.
E.g. I try to use "window.plugins.OneSignal.Notifications.permission" to get permission state and get undefined. In console I see window.plugins.OneSignal.Notifications has _permission property (prefixed with underscore). Does it mean the plugin was initialized the wrong way? Or it is just not mentioned in docs?
Some other methods described in docs are not defined even with underscore, e.g. window.plugins.OneSignal.Notifications.addPermissionObserver.
Code of Conduct
The text was updated successfully, but these errors were encountered: