I'm writing an Ionic app and trying to make Push Notifications to work.
I'm using the phonegap-plugin-push plugin to do so.
On the "$ionicPlatform.ready" event I get the device token
var push = PushNotification.init({
android: {
senderID: "36112019308"
}
});
push.on('registration', function(data) {
window.localStorage.setItem('tkn', data.registrationId );
});
well, here I get the registration id. Now, when I try to follow the steps described here, with a curl command like the following
curl --header "Authorization: key={KEY_GOT_ON_GOOGLE_CONSOLE}" --header "Content-Type: application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"THE_REGISTRATION_ID_GOT_ON_DEVICE"]}"
I get the error:
{"multicast_id":4787366485826638756,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}
Well, I am confident that the key and the registration id are correct because if I change the key I get unauthorized error and if I change the registration id I get InvalidRegistration error
What could be that I am doing wrong?
Aditional Info
- Testing with debug build