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