Skip to content

[Question]: Any way to get feedback when the shim fails to load onesignal? #1197

@ggrochow-dh

Description

@ggrochow-dh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions