I want to send notification in ionic app using FCM but first I want to get device token using FCM. I have already tried below method to get device token.working. But I want to get device token using FCM. Anyone knows how to get, kindly help.
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    var push = new Ionic.Push({
      "debug": true
    });
    push.register(function(token) {
      console.log("My Device token:",token.token);
      push.saveToken(token);  // persist the token in the Ionic Platform
    });
  });
})