Diego Dillenburg Bueno
Posts: 0
Joined: Mon Oct 20, 2014 1:42 pm

How to get GCM RegistrationID via JavaScript

Hello,

is there any way that I can retrieve the Android's GCM RegistrationID that is replied when a device is successfully registered in the GCM Server when enabling push notifications here in Appery trhough JavaScript?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to get GCM RegistrationID via JavaScript

Hello Diego,

Device ID is stored in the local storage variable pushNotificationDeviceID. Please look here: https://getsatisfaction.com/apperyio/...

Diego Dillenburg Bueno
Posts: 0
Joined: Mon Oct 20, 2014 1:42 pm

How to get GCM RegistrationID via JavaScript

But this is the deviceID I have stored in the devices collection, right? When trying to post it directly to GCM I get the invalidRegistration error, which means that this ID isn't matching the one at GCM, am I right?

Diego Dillenburg Bueno
Posts: 0
Joined: Mon Oct 20, 2014 1:42 pm

How to get GCM RegistrationID via JavaScript

As stated here in this other answer: https://getsatisfaction.com/apperyio/... I'm able to grab the ID via JavaScript to directly send to GCM or APNS, but how to do so? That's what I tried to ask from the beggining, sorry for misundertoods.

The values I have at my devices table aren't the ones that I'm needing at the moment.

Thanks in advance,
Diego Dillenburg Bueno

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to get GCM RegistrationID via JavaScript

Hello Diego,

If you are not using the services of Appery.io and want to send push notifications, you need to understand how the plugin for pushes work and use it as you wish. You may connect any other Cordova plugin for push and use it according to its API. But unfortunately this is out of scope of out support.

Diego Dillenburg Bueno
Posts: 0
Joined: Mon Oct 20, 2014 1:42 pm

How to get GCM RegistrationID via JavaScript

Oh thanks, that would be it then. I'll use the other plugin I had seen. Just one more question: how can I import the plugin? Because on the plugin list it doesn't appear the plugin I want. How do I manually add a plugin I want?

Thanks

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to get GCM RegistrationID via JavaScript

Hello Diego,

Hope this link will help you: http://devcenter.appery.io/documentat...

Diego Dillenburg Bueno
Posts: 0
Joined: Mon Oct 20, 2014 1:42 pm

How to get GCM RegistrationID via JavaScript

Thanks Evgene, I have already read that documentation, but the plugin I want to add isn't listed there. If I put it in the "SOURCE" of the project, will it work?

Return to “Issues”