当用户从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));
});
}
}