Hi friends,
I am using ionic push. After the updation of ionic 2.0 push is not working. It shows “init is not
defined” in the register part. I have changed $ionicPush to $cordovaPush then I am getting “pushNotification is not defined” .Also it is not generating device token when I tried it with my android mobile. Can anyone help mw out of this? here is my code
var push = new Ionic.Push({
“debug”: true,
“onNotification”: function(notification) {
var payload = notification.payload;
console.log(notification, payload);
},
“onRegister”: function(data) {
console.log(data.token);
},
“pluginConfig”: {
“android”: {
“iconColor”: “#343434”,
“badge”: true,
“sound”: true
}
}
});
$cordovaPush.register(function (token) {
console.log("Device token:", token.token);
push.saveToken(token); // persist the token in the Ionic Platform
});
Thanks in Advance