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
In the first step of my code, I initialize OneSignal with the function OneSignal.initialize().
In the second step, I want to use the OneSignal.Notifications.permission field to query whether the system permission are still available.
However, as the initialize() function is not asynchronous, the field OneSignal.Notifications.permission returns an incorrect result.
The same happens for other fields such as OneSignal.User.pushSubscription.optedIn.
If I wait 200ms after initialization, the fields return the correct results.
So shouldn't the initialize function be asynchronous and wait for all fields to be initialized? Is this possible in a future release?
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
How can we help?
In the first step of my code, I initialize OneSignal with the function OneSignal.initialize().
In the second step, I want to use the OneSignal.Notifications.permission field to query whether the system permission are still available.
However, as the initialize() function is not asynchronous, the field OneSignal.Notifications.permission returns an incorrect result.
The same happens for other fields such as OneSignal.User.pushSubscription.optedIn.
If I wait 200ms after initialization, the fields return the correct results.
So shouldn't the initialize function be asynchronous and wait for all fields to be initialized? Is this possible in a future release?
Code of Conduct
The text was updated successfully, but these errors were encountered: