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]: playerId sometimes for some users is empty #2232

Open
1 task done
tosuccesspractice opened this issue Dec 12, 2024 · 0 comments
Open
1 task done

[Bug]: playerId sometimes for some users is empty #2232

tosuccesspractice opened this issue Dec 12, 2024 · 0 comments

Comments

@tosuccesspractice
Copy link

What happened?

playerId is empty for some users when i retrieve it with OneSignal.getUser().getPushSubscription().getId() to send it to my backend i also tried to get it after X minutes after launching the application

Steps to reproduce?

Install on Android application implementation 'com.onesignal:OneSignal:[5.0.0, 5.99.99]'
Initialize OneSignal on myApplication like that : 

        OneSignal.initWithContext(this);
        String ONESIGNAL_APP_ID = "XXXXXX";
        OneSignal.initWithContext(this, ONESIGNAL_APP_ID);

And later when trying to get the playerId :
OneSignal.getUser().getPushSubscription().getId() it's empty 

the problem is also reproduced when notification for the application first is disabled and when notification become enabled, OneSignal.getUser().getPushSubscription().getId() return always empty
i try using OneSignal.getUser().getPushSubscription().optIn(); and that change nothing to the problem

What did you expect to happen?

I except getting playerId value

OneSignal Android SDK version

5.0.0

Android version

15, 14, 13

Specific Android models

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

1 participant