Android push notifications using node/phonegap/ionic

I'm following this tuto : http://intown.biz/2014/04/11/android-notifications/ Im developing a node/angular/phonegap/ionic app, using node-gcm to send notifications. But I have troubles understanding some parts of the tuto. In the last part of the code, the Android application code, you can see :

registerID : function (id) {
            //Insert code here to store the user's ID on your notification server.
            //You'll probably have a web service (wrapped in an Angular service of course) set up for this. 
            //For example:
            MyService.registerNotificationID(id).then(function(response){
                if (response.data.Result) {
                    console.info('NOTIFY  Registration succeeded');
                } else {
                    console.error('NOTIFY  Registration failed');
                }
            });

So I have to code a service (called MyService here) that will get user's ID, right?

Problem is : I don't understand everything, Im not even sure which ID we're talking about here. Is that the ID of an android device?

Yes, you have to write a service that would send the registration id to your server.

The registration id is not an id of an Android device. It's an id that GCM assigns for an application instance on a device. Your server uses that id to send a message to your app on a specific device.

You can use a service/factory like this

app.factory('registerId', ['$http',function($http){
return {
  registerNotificationID: function(id){
      $http
          .post(serverurl+'register-device',{id:id, platform:'android'})//TODO: Change it for Each Platform before building.
          .success(function(res){
              console.log(res)
          })
          .error(function(e){
              console.error(e.message)
          })
      }
      }
}

This should send a POST request to the server on /register-device/ and you can process it from there, and make sure to Inject the factory/service in DI