Bower component for iOS and Android Push Notifcation services. Check out node-apn and node-gcmhttps://github.com/ToothlessGear/node-gcm) to implement push notification services on a node.js server.
- bower install angular-phonegap-push-notification
- Made sure the
cordova-*.js
script is in your.html
file. - Replace {your_sender_id} with your GCM sender id
- Include the
push.js
script, and this script's dependencies are included in your app. - Add
cordova
as a module dependency to your app.
- send the device_id to an application server
- store the device_id on the application server
- send push notifications with the device_id/token
var result = push.registerPush(function (result) {
if (result.type === 'registration') {
localStorage.setItem('device_id', result.id);
localStorage.setItem('device', result.device);
}
});
MIT