We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using version "react-native-onesignal": "^5.1.3",
"react-native-onesignal": "^5.1.3",
Initializing the OneSignal SDK in App.js in my React-native application like so:
useEffect(() => { StatusBar.setBarStyle('dark-content'); //OneSignal Init Code OneSignal.initialize(cloudFunctionConfig.OneSignalAppID); }, []);
I am using getIdAsync and getOnesignalId functions and it always returning null
getIdAsync
getOnesignalId
hasOptedIn always comes as true so that part is working.
hasOptedIn
true
getTokenAsync also returns the value.
getTokenAsync
useEffect(() => { async function setPlayerId() { try { if (!OneSignal) { console.log('OneSignal is not initialized'); return; } console.log('OneSignal', OneSignal); OneSignal.login(user?.uid); OneSignal.User.pushSubscription.optIn(); const hasOptedIn = await OneSignal.User.pushSubscription.getOptedInAsync(); console.log('hasOptedIn', hasOptedIn); const onesignalId = await OneSignal.User.getOnesignalId(); console.log('onesignalId', onesignalId); const playerId = await OneSignal.User.pushSubscription.getIdAsync(); console.log( 'getPushSubscriptionId', await OneSignal.User.pushSubscription.getIdAsync(), await OneSignal.User.pushSubscription.getTokenAsync(), await OneSignal.User.pushSubscription.getOptedInAsync(), ); console.log('playerId', playerId); } catch (error) { console.log('setPlayerId error', error); } finally { setEffect2Done(true); } } setPlayerId(); }, [user, loadingUser]);
The text was updated successfully, but these errors were encountered:
Experiencing the same thing with 5.1.3 and the latest release 5.2.0. Works fine with 5.1.0.
5.1.3
5.2.0
5.1.0
Sorry, something went wrong.
Hi @rikinshah23 and @wneild are you seeing this on both iOS and Android?
Experiencing the same thing with 5.2.0 on android. It seems to work fine on iOS.
Also I reverted back to 5.0.0 and using the sync version of the API , I also cannot see the notificationId anymore.
sync
No branches or pull requests
How can we help?
I am using version
"react-native-onesignal": "^5.1.3",
Initializing the OneSignal SDK in App.js in my React-native application like so:
I am using
getIdAsync
andgetOnesignalId
functions and it always returning nullhasOptedIn
always comes astrue
so that part is working.getTokenAsync
also returns the value.Code of Conduct
The text was updated successfully, but these errors were encountered: