Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49171

$ionicPlatform.ready() not firing in Android

$
0
0

@thewozjesse wrote:

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);
    });
  });
})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49171

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>