I am using parse-phonegap-plugin-push to register cordova android app with google cloud messaging. But it did not return anything.
I ran the app in Android Device but still did not get anything and double checked my sender id also. I am using cordova in visual studio 2017.
Code:
function onDeviceReady() {
document.addEventListener( 'pause', onPause.bind( this ), false );
document.addEventListener('resume', onResume.bind(this), false);
var push = PushNotification.init({
"android": { "senderID": "XXXXXXXXXX" },
"ios": { "alert": "true", "badge": "true", "sound": "true" }, "windows": {}
});
push.on('registration', function (data) {
console.log(data.registrationId);
document.getElementById("gcm_id").innerHTML = data.registrationId;
// data.registrationId
});
push.on('notification', function (data) {
// data.message,
// data.title,
// data.count,
// data.sound,
// data.image,
// data.additionalData
});
push.on('error', function (e) {
console.log(data.message);
document.getElementById("gcm_id").innerHTML = data.message;
});
};