-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
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
(v3.2.1) (iOS) pushToken null on real device #503
Comments
I found the same problem #502 So last version isn`t working |
(its not in my podfile this time) |
@Jarred-Sumner Try uninstalling the app from your device, then re-install it, does it prompt you to accept push notification permissions? Also, just to check, you did enable the Push Notifications capability in Project Settings > Capabilities, correct? |
Yes
I downgraded to |
@Jarred-Sumner Just to understand this issue a bit better, the ID's are null, but do push notifications actually work? They shouldn't, but I wanted to double check. Also, can you try updating to 3.2.2, initialize with JS, and call |
Issue persists on 3.2.2. Called init with app ID: (null) But userId is still null. I have included the library using CocoaPods if that helps |
@hhunaid it is expected that the app ID will be null the first time (perhaps we should remove that first log statement to avoid confusion). It is also expected that user ID will be null until the user accepts push permission on a real iOS device. Can you confirm this is the case? If so, can you post a link to at least 15 seconds of log output from Xcode with that log level (make sure to call setLogLevel before calling init) |
@Nightsd01 it's not just the LOG statement. There is actually a call to OneSignal initializer with null appId. I just checked that if I remove that init line in |
@hhunaid yes, it is expected that the first call to the initializer will be with a null App ID, this is how many of our wrapper SDK’s work. You are saying that if you remove this first call, “everything works”...? In order to rule out other changes you may have made, can you uncomment initOneSignal again to verify it stops working...? Can you post your |
I have tried on and off with and without the mentioned piece of code and now I can say with confidence that indeed it is the culprit. At least in my app. |
@dooboolab You are using JS initialization, correct? Can you tell me where in your project you are calling |
For the life of me I cannot reproduce this issue. If someone could reproduce this issue in a demo project and post it we'd be able to fix this issue much faster. |
@tavriaforever hi, so downgrade & call onesignal.init('app id') would work? |
same issue here, any solution ?
|
@Nightsd01
Still suffering from getting null token. |
@Nightsd01 Same here. |
@Nightsd01 I just tried on android, and android have same problem. |
I guess JS-side initialization was not such a great idea. |
@hhunaid sounds like I should downgrade? |
@dooboolab @408dev yes, I would recommend that if you're encountering this issue, you downgrade to 3.1.4 for the time being until we sort this issue out. Apologies. Keep in mind that JS init was not supported in 3.1.4 so you will want to follow the guide to add the native initialization code to your project. @hhunaid it does indeed make things easier for react devs. |
As an update, we've been able to reproduce this issue and have identified the cause, we'll be rolling out an update to resolve it soon. |
Hi everyone - this issue has been resolved in a new PR (#512). We expect to have this merged and a new update released within the next hour or two. Thanks for your patience! |
Hi everyone @dooboolab @hhunaid @408dev @el-lsan @neo125874 @Jarred-Sumner The new update (3.2.3) has been released and should fix this issue. Please feel free to let me know if you see this issue (or other issues) again and I'll be happy to investigate. |
@Nightsd01
on real device everything works fine as expected, but im still receiving
|
@el-lsan that is expected. It is Apple’s restriction, not ours. iOS simulators cannot receive push notifications. They will not get an APNS push token and won’t get registered with OneSignal. If you are testing push notifications, you have to do it on a real iOS device, whether you use OneSignal or not. |
@Nightsd01 Here's the response of OneSignal.getPermissionSubscriptionState for the listed simulator: But most of the times initialization fails on simulators and I don't see it under |
@el-lsan I have same issue push token is null, did you find solution? |
@adirzoari after updating to On the other hand i'm expecting |
Im using real device and get null token |
@adirzoari Thats weird! Try clearing the cache |
@el-lsan pushToken is null but in userId has unique string. in onesignal I get |
I had the same issue with 3.2.7 (simulators - OK/real devices - NOK) but cleaning cache as suggested by @el-lsan got it running with no problem |
hi, would u please the add the image of the following change. |
hi i am getting pushToken:null in simulator, and getting only the userId for the simulator. |
Description:
Cannot get pushToken, no one ios users on dashboard, I try evething, I recreate certificates, keys, use provisioning tools, try on diffrent real devices.
On android everything works like a charm.
Environment
latest 3.2.1
npm i --save react-native-onesignal
Version 9.3 (9E145)
my package.json
Steps to Reproduce Issue:
js code
I got response from
getPermissionSubscriptionState
:Of course no one ios user on dashboard.
Additional I see logs in xcode
The text was updated successfully, but these errors were encountered: