cordova - Phonegap push plugin and GCM. Is it that complicated? -


i've been trying phonegap / cordova app (for android) work gcm no luck.

i've followed documentation here: https://github.com/phonegap/phonegap-plugin-push
setting sample phonegap application , sending notification using phonegap cli built-in push function quite easy , works expected.

the problem starts when i'm trying work gcm account.
started setting sender_id gcp project number (verified correct id...)

i executed "phonegap serve" cli , accessed phonegap android developer app in order receive new device registration id , got new registration id (after clearing app data).

the problem think device doesn't registered gcm because if enter "test123xxx" sender id, still new device registration id suspect setting sender_id alone won't trick , question how phonegap app register device gcm?

any appreciated! thank you.

edit - found solution @jcesarmobile

apparently when using "phonegap serve" push plugin use phonegap internal "push" function , won't register gcm, had build app , worked, used android studio debug on device if helps someone...

please try these steps register gcm given in registering client apps:

  1. the client app obtains registration token using instance id api. call api must have authorized entity set app server's sender id, , scope set appropriate value gcm (depending on platform). refer api reference full detail on api.

  2. the client app passes registration token app server.

  3. the app server saves registration token , acknowledges client app process completed successfully.

if app server fails complete part of registration handshake, client app should retry sending registration token server or delete registration token.

also, please try going through tutorial on implement push notifications in phonegap application. hope helps!


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -