Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Ionic push generates the same token

$
0
0

@patrioticcow wrote:

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);
});

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>