I am getting 404 error when I try to create notification_key in gcm using node.js. My code is
var request = require('request');
request.post({
uri: 'https://android.googleapis.com/gcm/notification',
request:
{
"operation": "create",
"notification_key_name": "appUser-Chris",
"notification_key": "aUniqueKey",
"registration_ids": ['**', '****']
},
headers: {
'content-type': "application/json",
'project_id' : 'fluid-booking-638',
'Authorization' : 'key=*****'
}
}, function(err, response, body) {
console.log(err);
console.log(response);
console.log(body);
});
Where am I doing mistake ?
Thanks in advance.
I think you are wrong here :
'project_id' : 'fluid-booking-638',
Use the project number (the 12 digits number your app uses in order to register to GCM.
I know that the docs say
Header : "project_id":
But the docs have been known to mix the terms projectID
and projectNumber
before. In fact, originally the 12 digits number used to be called the project ID.