Кордова-Pushbots. Как вызвать функцию onDeviceReady и установить Alias при входе пользователя из проекта Angular - inAppBrowser
Как позвонить onDeviceReady
Функция и как установить псевдоним при входе пользователя из проекта Angular - inAppBrowser.
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));
});
}
}