I’m building a very simple app that’s testing push notifications. I have the phonegap-plugin-push plugin installed and I’m trying to console.log a device token when the platform readies, but the console.log events aren’t firing. Console.log will fire before $ionicPlatform.ready(), but not inside of its callback. What am I doing wrong?
Relevant code:
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
var push = new Ionic.Push({
"debug": true
});
push.register(function(token) {
console.log("Device token:",token.token);
});
});
})