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 is Init async, and shouldnt the window["onesignal"] queue get initialized earlier? #78

Open
timbrownsf opened this issue Aug 25, 2022 · 3 comments
Labels
Enhancement / Feature New feature or request

Comments

@timbrownsf
Copy link

How can we help?

Init doesnt look like it needs to be async. It would be nice if it wasnt - most 3rd party trackers arent.
Also, the window["OneSignal"] property seems to only be instantiated inside of the handleOnLoad method (which is called after the script is loaded). Shouldnt the property and queue be initialized immediately during init/module import vs when the script asynchronously returns?

Thank you!

@rgomezp
Copy link
Contributor

rgomezp commented Sep 15, 2022

Howdy,
Thanks for your patience.

I think you make an excellent point. Before making a decision, we would have to carefully consider the switch. That said, I can't think of a reason this cannot be done at the moment. However, note that we would not be able to remove this until a future major release.

If you could provide us with more info as to why this is important to you and how you are using the package, it may help guide us in our efforts.


Internal note:
Related context: #59

@rgomezp rgomezp added the Enhancement / Feature New feature or request label Sep 15, 2022
@timbrownsf
Copy link
Author

This is important if someone tries to send data to OneSignal before the handleOnLoad method has been invoked

@rgomezp
Copy link
Contributor

rgomezp commented Sep 15, 2022

@timbrownsf ,
I see. Are you trying to do something like set user data tags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement / Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants