简体   繁体   中英

Registering to push notifications results in an “Invalid Action” error on Android

I'm trying to use PhoneGap's push notification plugin, but receive and error when trying to register for push notifications on Android (haven't tested on other platforms). For testing purposes I created a minimal sample app that reproduces this problem.

Install sample app

View sample app source code

Your help is greatly appriciated :-)

I found the problem. I wasn't using the plugin as I should have; instead of writing this:

pushNotification.register(pg_success_handler, pg_error_handler, {
  "senderID": "<sender id>",
  "ecb": on_pg_gcm_notification
});

I should have written this:

pushNotification.register(pg_success_handler, pg_error_handler, {
  "senderID": "<sender id>",
  "ecb": "on_pg_gcm_notification"
});

The registration works now :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM