Issue with OneSignal Integration in React Native - Failed Notification Delivery

75 Views Asked by At

I am encountering an issue while integrating OneSignal into my React Native application. Despite proper configuration, notifications sent from the OneSignal UI are marked as failed in the delivery section. Unfortunately, I am unable to find detailed error information.

Here's a snippet of my React Native code for integrating OneSignal:

`useEffect(() => {
    SplashScreen.hide();
    OneSignal.initialize(APPID);
    OneSignal.Notifications.requestPermission(true);
    OneSignal.Debug.setLogLevel(LogLevel.Verbose);
    let externalId = "MYID"; // You will supply the external id to the OneSignal SDK
    OneSignal.login(externalId);
    OneSignal.Notifications.addEventListener(
    'foregroundWillDisplay',
       (notificationReceivedEvent) => {
        let notification = notificationReceivedEvent.getNotification();
        console.log("notificationReceivedEvent ", notification);
     },
  );
  }, []);
  `

Upon inspecting the logs, I found the following error messages:

Task .<3> request https://api.onesignal.com/apps//users/by/onesignal_id/ is NOT allowed to set HSTS for main doc (null) flipper: Desktop failed to provide certificates. Error from flipper desktop: rsocket::StreamInterruptedException: connection error I need assistance in identifying the root cause of the failed notification delivery and understanding the implications of the HSTS error and the Flipper desktop error.

Any guidance or suggestions on resolving this issue would be greatly appreciated. Thank you! Checked and confirmed the OneSignal configuration. Reviewed documentation and OneSignal logs. Verified that the external ID is correctly set. Investigated HSTS and Flipper errors in the logs.

0

There are 0 best solutions below