Ready event not firing

I have an Ionic app which works perfectly in Android and on the iOS emulator, but not on an actual iOS device (I’m using ionic package to build it). When I run the app, the following happens:

First time I run it: the ready event is not fired, but my home controller is displayed and is functional.

So I close the app and re-open it.

Second time I run it: the ready event is fired and I initialise various things including Push and Ads. However, I am not asked whether I want my phone to receive notifications and I do not see any adverts.

So I close the app again. At this point (when the app has just closed) I’m asked about notifications, so I agree and then re-open the app.

Third time I run it: the ready event is again fired, everything initialises again and adverts are displayed.

I’ve tried a number of things including re-ordering the scripts in index.html, manually bootstrapping and a huge number of try/catchs to find out what - if anything - is failing. I am stumped and would appreciate ideas.



<link href="lib/ionic/css/ionic.min.css" rel="stylesheet">
<link href="css/styles.min.css" rel="stylesheet">

<script src="lib/ionic/js/ionic.bundle.min.js"></script>
<script src="cordova.js"></script>

<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/directives.js"></script>
<script src="js/services.js"></script>


<body ng-app="fwp">


app.js (note: the call to Statics.getAllCompetitions is always called and is always successful):

angular.module("fwp", ["ionic", "fwp.controllers", "fwp.directives", ""])

.run(function ($http, $ionicPlatform, $ionicPopup, $state, Statics) {

    $ionicPlatform.ready(function () {

        //hide the accessory bar by default
        if ((window.cordova)&&(window.cordova.plugins)&&(window.cordova.plugins.Keyboard)) {

            //hide keyboard accessory bar


        //status bar found
        if (window.StatusBar) {

            //style status bar


        //initialise everything



.config(function ($ionicConfigProvider, $stateProvider, $urlRouterProvider) {

    //remove back label

    // Ionic uses AngularUI Router which uses the concept of states
    // Learn more here:
    // Set up the various states which the app can be in.
    // Each state's controller can be found in controllers.js

        // setup an abstract state for the tabs directive
        .state("tab", {
            url: "/tab",
            abstract: true,
            templateUrl: "templates/tabs.html"

        .state("tab.home", {
            cache: false,
            url: "/home",
            views: {
                "tab-home": {
                    templateUrl: "templates/mainMenu.html",
                    resolve: {
                        allCompetitions: function (Statics) {
                            return Statics.getAllCompetitions();
                    controller: "HomeCtrl"