I've been reading through doc after doc after doc (and by that I mean site after site) where people run into this error and it has to do with the project # for the app.
target = "reallylongdeviceid"
GCM.format = :json
GCM.key = "apikey"
# found at https://console.developers.google.com/project/766********7/apiui/credential?authuser=0
# the number found in the url there, the project number, is a linked sender id on play.google.com/apps/publish/etc....../
data = {:message => "test push" }
GCM.send_notification(target, data)
GCM.send_notification(target)
[{:response=>"success", :body=>{"multicast_id"=>obfuscated, "success"=>0, "failure"=>1, "canonical_ids"=>0, "results"=>[{"error"=>"MismatchSenderId"}]}, :headers=>{"content-type"=>["application/json; charset=UTF-8"], "date"=>["Wed, 03 Sep 2014 19:08:56 GMT"], "expires"=>["Wed, 03 Sep 2014 19:08:56 GMT"], "cache-control"=>["private, max-age=0"], "x-content-type-options"=>["nosniff"], "x-frame-options"=>["SAMEORIGIN"], "x-xss-protection"=>["1; mode=block"], "server"=>["GSE"], "alternate-protocol"=>["443:quic"], "connection"=>["close"]}, :status_code=>200}]
[{:response=>"success", :body=>{"multicast_id"=>obfuscated, "success"=>0, "failure"=>1, "canonical_ids"=>0, "results"=>[{"error"=>"MismatchSenderId"}]}, :headers=>{"content-type"=>["application/json; charset=UTF-8"], "date"=>["Wed, 03 Sep 2014 19:10:19 GMT"], "expires"=>["Wed, 03 Sep 2014 19:10:19 GMT"], "cache-control"=>["private, max-age=0"], "x-content-type-options"=>["nosniff"], "x-frame-options"=>["SAMEORIGIN"], "x-xss-protection"=>["1; mode=block"], "server"=>["GSE"], "alternate-protocol"=>["443:quic"], "connection"=>["close"]}, :status_code=>200}]
I inherited this project and apparently push notifications never worked. It looks like it's an error with the ID that the app registers with, but what's in the phonegap codebase when the app starts, and what's setup as a linked sender ID match. I'm new to looking at push notifications and just want to try to get this working but I'm not sure where to look. This probably isn't related to pushmeup, but any help someone could offer I would appreciate.