Skip to content
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

[Bug]: Player ID /Subscrption ID getting NULL #2239

Open
1 task done
DineeshPadippurakkal opened this issue Jan 6, 2025 · 1 comment
Open
1 task done

[Bug]: Player ID /Subscrption ID getting NULL #2239

DineeshPadippurakkal opened this issue Jan 6, 2025 · 1 comment

Comments

@DineeshPadippurakkal
Copy link

DineeshPadippurakkal commented Jan 6, 2025

What happened?

image

Steps to reproduce?

Player id getting null once it registerd and also inside the observer
implementation 'com.onesignal:OneSignal:[5.0.0, 5.99.99]'

What did you expect to happen?

I need the player ID for push notifications

OneSignal Android SDK version

'com.onesignal:OneSignal:[5.0.0, 5.99.99]'

Android version

14

Specific Android models

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nan-li
Copy link
Contributor

nan-li commented Jan 10, 2025

Hi @DineeshPadippurakkal,

The push subscription observer will fire for any change to the push subscription. In this callback, it may be that the push token has been changed but the subscription ID has not yet become available.

Once the subscription ID becomes available, your observer should fire again. You can do a null check for the subscription ID before saving it with savePlayerid().

Please check the previous state and compare to the current to see what changed.

Also please let us know the exact OneSignal SDK version you are using, rather than the range [5.0.0, 5.99.99].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants