Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Docs are not accurate? #924

Closed
1 task done
julia-fix opened this issue Sep 27, 2023 · 2 comments
Closed
1 task done

[question] Docs are not accurate? #924

julia-fix opened this issue Sep 27, 2023 · 2 comments

Comments

@julia-fix
Copy link

julia-fix commented Sep 27, 2023

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.

2023-09-27

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nan-li
Copy link
Contributor

nan-li commented Sep 27, 2023

Hi @julia-fix, thanks for reporting this,

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.

@jennantilla
Copy link
Contributor

Closing issue-- @julia-fix let us know if you have any additional questions or concerns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants