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

[question]: how to get playerId(userId) in this version? #794

Closed
1 task done
lyfer-bob opened this issue Nov 28, 2023 · 4 comments
Closed
1 task done

[question]: how to get playerId(userId) in this version? #794

lyfer-bob opened this issue Nov 28, 2023 · 4 comments

Comments

@lyfer-bob
Copy link

lyfer-bob commented Nov 28, 2023

How can we help?

in old version i can get by
var status = await OneSignal.shared.getDeviceState(); var playerId = status!.userId;

but in this version can't call getDeviceState() .

Code of Conduct

  • I agree to follow this project's Code of Conduct
@salamohamad
Copy link

Yes, having same issue. Just updated to ^5.0.4 but cant seem to find the player ID for internal keep

@nan-li
Copy link
Contributor

nan-li commented Dec 19, 2023

Hi @lyfer-bob and @salamohamad, if you are looking for the push subscription ID (most equivalent to the player ID in v3.x.x), it can be retrieved via var id = OneSignal.User.pushSubscription.id.

If you are looking for the user-level onesignalId, it will be available in a future release.

@masreplay
Copy link

Any updates?

@jennantilla
Copy link
Contributor

Hello everyone!

Just an update that onesignalId is now also available on the Flutter SDK.

Please upgrade to the latest Flutter SDK to use the new methods, User.getExternalId and User.getOnesignalId. Please refer to our migration guide for full details!

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

5 participants