OneSignal / react-onesignal

React OneSignal Module: Make it easy to integrate OneSignal with your React App!
Other
74 stars 23 forks source link

Fix missing reject for init #139

Open fehergeri13 opened 3 months ago

fehergeri13 commented 3 months ago

When I init the oneSignal sdk with some invalid config, I get the following error:

try {
    await OneSignal.init({ appId: "example app id" });
} catch(e) {
    console.log("error with init")
}
Uncaught (in promise) Error: OneSignalSDK: HTTP sites are no longer supported starting with version 16 (User Model), your public site must start with https://. Please visit the OneSignal dashboard's Settings > Web Configuration to find this option.

This is an example error. The main issue is that the error is uncaught.

This PR will fix the uncaught exception