OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
625 stars 214 forks source link

How to get the Onesignal ID on the last version? #782

Closed rignaneseleo closed 1 year ago

rignaneseleo commented 1 year ago

I am trying to get the Onesignal ID to configure RevenueCat via setOnesignalID(String onesignalID)

Onesignal ID was previously available in v3.x.x but now only the subscription ID and the token are available from the Onesignal.User.pushSubscription.id property.

How can I get it?

Code of Conduct

nan-li commented 1 year ago

Hi @rignaneseleo, Thanks for asking, this was also asked by others, please see this response.

You will have to use the REST API or Server SDK, but we are going to add a getter for onesignal ID.

MuhammedRefaat commented 3 months ago

OneSignal id can be retrieved using:

String? oneSignalId = await OneSignal.User.getOnesignalId();