You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Howdy,
I would recommend putting the getDeviceState call in a subscription observer. I'm not sure what your use case is for it, but it's possible that the device state is firing before the subscription fully completes.
Notice the warning we give in the documentation regarding this being a "snapshot" of the user state at that time. By putting it in the observer, you can be sure that the subscription has changed before trying to get the user state for it.
Note: this is similar to this issue. This could provide some potentially useful information as well.
One more thing, open up your Android studio to see if the logcat prints any other messages not shown in the RN logger
Description:
await OneSignal.getDeviceState() always undefined in android
Environment
react: 17.0.1
react-native: 0.64.1
react-native-onesignal: 4.1.1
without expo
added react-native-onesignal with npm
Steps to Reproduce Issue:
the console.log for android
iOS response
The text was updated successfully, but these errors were encountered: