Reputation: 773
I am developing an app using ionic2 and I want to retrieve the player id so I can store in my DB so my question is how to can I retrieve the OneSignal users' unique player after a user subscribes?
Upvotes: 1
Views: 523
Reputation: 4099
I assume you have already installed and configured OneSignal
plugin. Following is the code to get PlayerId
-
this.oneSignal.getIds().then(ids => {
console.log(JSON.stringify(ids['userId'])); //PlayerId
});
Upvotes: 1