0

I am using pushbots and trying to set an alias for my device, I could not find any code in the documentation to do so. I tried using below code

var Pushbots = PushbotsPlugin.initialize("569a8967177959f4778b4567", {
     "android":{
                "sender_id":"117196338125"
               }
    });
Pushbots.updateAlias("Test");

but it doesn't work. My device is showing up but without any alias

user1140237
  • 5,015
  • 1
  • 28
  • 56

1 Answers1

0

The problem is probably that updateAlias function is being executed immediately before device is fully registered. Try to set time out for 30 seconds or a minute before you set the alias and see if it works or try to put your code when you received your registration id.

Pushbots.on("registered", function(token){
    console.log("Registration Id:" + token);
    Pushbots.updateAlias("Test");
});

you can check similar thread here.

Ravi
  • 34,851
  • 21
  • 122
  • 183