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]: Why does the method OneSignal.initialize() not return a Future? #979

Open
1 task done
MarcelGalster opened this issue Dec 11, 2024 · 0 comments
Open
1 task done

Comments

@MarcelGalster
Copy link

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

  • I agree to follow this project's Code of Conduct
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

1 participant