Hello guys,
Someone has made it work push ionic in a ionic 1 project? I’m going crazy, I’ve been trying for months. I have this working but when I want to try production they dont get token:
var push = new Ionic.Push({
"debug": true,
"onNotification": function(notification) {
var payload = notification.payload;
console.log('notificacion data ---> '+notification, payload);
},
"onRegister": function(data) {
console.log('token notificacion data ---> '+data.token);
}
});
push.register(function (token) {
console.log("My Device token:", token.token);
push.saveToken(token); // persist the token in the Ionic Platform
var localStorage = window.localStorage;
localStorage.setItem('tokenDevice', token.token);
});
only works in dev_push true, when I set dev_push false NEVER WORKS
anyone can help me? I’m going crazy…