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]: Any way to get feedback when the shim fails to load onesignal? #1197

Open
ggrochow-dh opened this issue Sep 24, 2024 · 0 comments

Comments

@ggrochow-dh
Copy link

How can we help?

How do I know in my website code if onesignal will never actually load and be initialized?

In certain environments im running into this case

private static printEnvironmentNotSupported() {
let logMessage = 'OneSignal: SDK is not compatible with this browser.';
if (isIosSafari()) {
logMessage +=
' To support iOS please install as a Web App. See the OneSignal guide https://documentation.onesignal.com/docs/safari-web-push-for-ios';
}
console.log(logMessage);
}
}

I don't see any way to tell if this happens other than a console.log being output, in these cases my init function just sits in the OneSignalDeferred array forever.

How can I detect when this happens in code so I can instruct the user this page will never work unless they take some action to fix it.

I can get onError callbacks to track when the script itself fails to load, but in these cases your script loads, then proceeds to do nothing.

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