科尔多瓦-推动者。用户从Angular项目登录时如何调用onDeviceReady函数并设置别名-inAppBrowser

时间:2018-11-20 13:06:44

标签: angular cordova inappbrowser pushbots

当用户从Angular项目inAppBrowser登录时,如何调用onDeviceReady函数以及如何设置别名。

onDeviceReady: function() {
   window.open = cordova.InAppBrowser.open;
   var ref = cordova.InAppBrowser.open('****************', '_blank');
   window.plugins.PushbotsPlugin.initialize("**************", {"android":{"sender_id":"*******"}});
   if(window.localStorage.getItem("loggedIn") == "1"){
      var username = window.localStorage.getItem("username");
      window.plugins.PushbotsPlugin.setAlias(username);
      app.receivedEvent('deviceready');
      window.plugins.PushbotsPlugin.on("registered", function(token){
         console.log("Registration Id:" + token);
      });   
      window.plugins.PushbotsPlugin.on("user:ids", function(data){
         console.log("user:ids" + JSON.stringify(data));
      });
   }
}

0 个答案:

没有答案