for reference I suggest http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html
I’ve implemented push with AWS, so that’s my documentation.
First you need to create an Google Play account and enable notification:
step 1) Create a Google API Project and Enable the GCM Service
In my case , I’m using AWS, I need to give AWS rights to send push messages to GCM (GCM is connected to your android device)
Step 2: Obtain the Server API Key
Step 3:
Install the cordova push plugin (http://ngcordova.com/docs/plugins/pushNotifications/)
Read the documentation at the android section … especially the registration part. The app needs to register for push. For example
$cordovaPush.register(androidConfig).then(function(result) {
// Success
}, function(err) {
// Error
})
if succesfull , the app will trigger an notifiaction … the part of
$rootScope.$on('$cordovaPush:notificationReceived', function(event, notification) {
and it will have an notification.event :
switch(notification.event) {
case 'registered':
if (notification.regid.length > 0 ) {
alert('registration ID = ' + notification.regid);
}
break;
So now you have an registration id … in my case … I need to submit the registration id to my server. From my server it will create an new subscriber (in a Google APP) on AWS. The app is connected to GCM. Now from the AWS console I can send a message to the subscriber (endpoint), wich will send a message to GCM, wich sends a notification to the registered device.