This is licenced under the MIT open source licence http://opensource.org/licenses/MIT
Google Cloud Messaging Project ID
Google Cloud Messaging API Key for above Project ID (need for server)
App ID configured for Push Notifications on Apple Developer Portal
SSL Certificate and private key (need for server)
cordova plugin add org.apache.cordova.device org.apache.cordova.vibration org.apache.cordova.dialogs org.apache.cordova.media https://github.com/phonegap-build/PushPlugin.git
Include following script lines to your index.html
to reference the PushNotification plugin.
<script type="text/javascript" src="push.js"></script>
<script type="text/javascript" src="pushnotification.js"></script>
Initialise Push Plugin in AngularJs by adding module pushNotify
pushNotification.registerPush();
Store the returned device registration ID to send future notifications to device
For android push notifications, use included android-erver.php
file.
Make sure to replace Google API key, and add array for devices to which you want to send notifications.
AngularJs example included with file named angular-example.js
.