Help with "token" in the push module
-
webcraftniray
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 8
-
Thank you received: 0
-
-
5 years 10 months ago #7004
by webcraftniray
Hi Luigi,
I'm wondering if you could help me with understanding the "token" when registering a device for push.
Is this the device UID? or is it a random identifier that I have to produce? Or is it a token I need to retrieve from Apple or Google?
Many thanks for clarifying.
Ray
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
-
webcraftniray
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 8
-
Thank you received: 0
-
-
5 years 9 months ago #7026
by webcraftniray
Thank you Luigi... this helped...
for anyone else needing help with this... this is how I got the token in Ionic 4 using the Native "Push" Cordova plugin (available here:
github.com/phonegap/phonegap-plugin-push)
import {Push, PushObject, PushOptions} from '@ionic-native/push/ngx';
...
if (this.platform.is('cordova')) {
const options: PushOptions = {
android: {},
ios: {
alert: 'true',
badge: true,
sound: 'true'
}
}
const pushObject: PushObject = this.push.init(options);
pushObject.on('registration').subscribe((registration: any) => {
// "registration.registrationId" now holds the token that needs to be sent back to jBackend
});
});
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.095 seconds