phonegap-build / PushPlugin

This repository is deprecated head to phonegap/phonegap-push-plugin
https://github.com/phonegap/phonegap-plugin-push
MIT License
1.32k stars 1k forks source link

Can't get GCM ID #682

Closed Yusadolat closed 8 years ago

Yusadolat commented 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.

macdonst commented 8 years ago

@Yusadolat the code you are using above is actually for this repo: https://github.com/phonegap/phonegap-plugin-push