Ionic push generates the same token


#1

hello,

I’m using the fallowing code to generate a token, the issue is that the same token gets generated every time i run the code:

any ideas?

Ionic.io();
var push = new Ionic.Push({
  "debug": false,
  "onNotification": function(notification) {
    var payload = notification.payload;
    console.log(notification, payload);
  },
  "onRegister": function(data) {
    console.log(data.token);

    var ionicUser = Ionic.User.current();
    push.addTokenToUser(ionicUser);
  }
});

push.register(function(data) {
  console.error(data);
});

#2

Can you explain more ? When you run it where ? On one device ?

If It is on the same device, it is normal. One token = one device (if the application is not removed and resintalled)


#3

@gensollen good point. ill try another device. thanks


#4

I apparently get different token each time I run the app, is there any way to fix it?