react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

[Bug]: Urgent Production OneSignal some users don't receive notifications

Open sirusbaladi opened this issue 1 year ago • 7 comments

What happened?

OneSignal Login and Notification Problem for Specific Users

Description

I'm experiencing an issue with OneSignal in our production environment where login and notifications have stopped working for some users, while continuing to function normally for others.

Current Behavior

  • For affected users:
    • Login to OneSignal no longer works
    • Last session in OneSignal dashboard is not updating
    • Users are not receiving notifications
  • For other users, everything works as expected

Debugging Steps Taken

  1. Added a button in the app to trigger a notification
  2. Logging IDs using:
    • OneSignal.user.getOneSignalID (always null)
    • OneSignal.user.getExternalID (this is correct)

Observations

  • The external ID is set correctly
  • Subscription records are not updated
  • Last session is not visible in the OneSignal dashboard for affected users

Suspected Cause

There's a suspicion that the logout process might be causing issues. In the app's logout method, OneSignal.logout is called. So logging in after logging out might not work.

Questions

  1. Could calling OneSignal.logout during the app's logout process be causing this issue?
  2. Why would this only affect some users and not others?
  3. Is there a way to reset or reinitialize OneSignal for affected users?

Additional Context

This issue is affecting production users, and I have no clear path to resolution as it's working correctly for the majority of users.

Impact

This issue is preventing affected users from receiving important notifications, significantly impacting their experience with my app.

Steps to reproduce?

1. Initialize OneSignal with `OneSignal.setAppId`
2. Ensure permissions are granted
3. Call `OneSignal.login` with the external user ID
4. For some users, this process fails silently

What did you expect to happen?

I expected the last session to be updated as well as the subscription tab in onesignal and users to receive notifications.

React Native OneSignal SDK version

"react-native-onesignal": "^5.1.0", "onesignal-expo-plugin": "^2.0.2",

Which platform(s) are affected?

  • [X] iOS
  • [ ] Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

sirusbaladi avatar Jul 08 '24 04:07 sirusbaladi

Hi @sirusbaladi thank you for reporting this. Do you have any logs available that include when login and/or logout are called? By any chance, do you have Identity Verification enabled for you app?

nan-li avatar Jul 08 '24 15:07 nan-li

Hi @sirusbaladi thank you for reporting this. Do you have any logs available that include when login and/or logout are called? By any chance, do you have Identity Verification enabled for you app?

I have OneSignal.Debug.setLogLevel(LogLevel.Verbose); but I don't see any logs at login, logout.

I don't have identity verification enabled.

sirusbaladi avatar Jul 08 '24 18:07 sirusbaladi

the only idea I have for now to create a new app in onesignal and change the keys in the app. but that's a painful process given that users who don't update the app won't receive notifications

sirusbaladi avatar Jul 08 '24 18:07 sirusbaladi

Any update here I am also experiencing this issue

gebrown43 avatar Aug 20 '24 19:08 gebrown43

Same here!

mtebele avatar Oct 03 '24 21:10 mtebele

Same here, can someone please give an update?

zguo123 avatar Oct 08 '24 19:10 zguo123

In my case, users who installed our app with OneSignal v4 and then updated it to the version with OneSignal v5 are not receiving notifications until they open the app. So, we cannot reach users who automatically updated the app!

We need an urgent solution.

mtebele avatar Oct 09 '24 04:10 mtebele

I have OneSignal.Debug.setLogLevel(LogLevel.Verbose); but I don't see any logs at login, logout.

@sirusbaladi I think something has gone wrong with login, likely the server call to log in this user has failed. This failure will result in no onesignal_id and no further updates, as you see in the dashboard. Without logs or more information, it is hard to know what is happening for these users. If you are able to reproduce, you will need logs from xcode or you will need to stream your phone to the Console app to retrieve logs for your ios device.

@mtebele your issue of notifications not received has been fixed, I believe we have followed up with you before.

@gebrown43 and @zguo123 please share any logs you have when you call login. The server call has likely failed and the logs will show the error.

nan-li avatar Jul 09 '25 22:07 nan-li

We didn't hear back, but if this issue comes up again, please share logs and we can take another look.

nan-li avatar Aug 05 '25 05:08 nan-li