Closed Yusadolat closed 8 years ago
Hello Good Morning Buddies, How are you doing today. I just install this Plugin and have been unable to get GCM ID. Here is the Js File.
document.addEventListener("deviceready",onDeviceReady,false); function onDeviceReady(){ console.log("Device Ready") var push = PushNotification.init({ "android": {"senderID": "721393051486"}, "ios": {"alert": "true", "badge": "true", "sound": "true"}, "windows": {} } );
push.on('registration', function(data) { console.log(data.registrationId); $("#gcm_id").html(data.registrationId); });
push.on('notification', function(data) { console.log(data.message); alert(data.title+" Message: " +data.message); // data.title, // data.count, // data.sound, // data.image, // data.additionalData });
push.on('error', function(e) { console.log(e.message); }); }
please review it and tell me where it error is. Thanks in Advance.
@Yusadolat the code you are using above is actually for this repo: https://github.com/phonegap/phonegap-plugin-push
Hello Good Morning Buddies, How are you doing today. I just install this Plugin and have been unable to get GCM ID. Here is the Js File.
document.addEventListener("deviceready",onDeviceReady,false); function onDeviceReady(){ console.log("Device Ready") var push = PushNotification.init({ "android": {"senderID": "721393051486"}, "ios": {"alert": "true", "badge": "true", "sound": "true"}, "windows": {} } );
push.on('registration', function(data) { console.log(data.registrationId); $("#gcm_id").html(data.registrationId); });
push.on('notification', function(data) { console.log(data.message); alert(data.title+" Message: " +data.message); // data.title, // data.count, // data.sound, // data.image, // data.additionalData });
push.on('error', function(e) { console.log(e.message); }); }
please review it and tell me where it error is. Thanks in Advance.