I am using ionic to develop an application and I need to get the device token for push notifications, but having trouble. The application isn\'t receiving noti
Here is the ng-Cordova document which is for getting current device token id.
copy and past it in your project controller.
In the given below line you can find notification parameter
$rootScope.$on('$cordovaPush:notificationReceived', function(event, notification)
The notification is an object and it will have an regid field which provides you the current mobile device id you can make use of that like (posting to server, view in console.log(notification);)
To send the device token to you server you need just do
var loginPost = {
"UserName":"Mike",
"PassWord":"xxxxxx",
"DeviceID":notification.regid
};
Using this loginPost variable object post to the server.