× Requests and support related to jBackend.

Help with "token" in the push module

  • webcraftniray
  • Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #7004 by webcraftniray
Help with "token" in the push module was created 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.

More
5 years 2 months ago #7015 by admin
Replied by admin on topic Help with "token" in the push module
Hi Ray
the token is the one you receive from the platform (Firebase or Apple) once the device registers itself to enable notifications from the app. Look at the description here:

www.selfget.com/documentation/jbackend-joomla30/devices.html

Best
Luigi

Please Log in or Create an account to join the conversation.

  • webcraftniray
  • Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 months ago #7026 by webcraftniray
Replied by webcraftniray on topic Help with "token" in the push module
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.

More
5 years 1 month ago #7050 by admin
Replied by admin on topic Help with "token" in the push module
Thanks for reporting

Please Log in or Create an account to join the conversation.

Time to create page: 0.086 seconds