title: How to resolve after resume or pause cordova events?
body: <p>We can listen for the events 'resume' and 'resolve' with the cordova event listeners. In the ionic platform, <a href="http://forum.ionicframework.com/t/how-to-detect-when-the-user-leaves-the-app-temporarily/20884/3" rel="nofollow">this corresponds to</a>:</p>
  
  <pre><code>  $ionicPlatform.on('resume', function() {
      $rootScope.$broadcast('onResume');
    });
  
    $ionicPlatform.on('pause', function() {
      $rootScope.$broadcast('onPause');
    });
  </code></pre>
  
  <p>Certain pages of my app require a resolve to take place (see authResolve below).</p>
  
  <p>However, how do I call the function resolve again once the user has exited the app (double click home button on iphone) and then returns? Like how do you combine the resolve function with the above cordova event listeners? Thank you!</p>
  
  <p><strong>app.js (part of)</strong></p>
  
  <pre><code>.config(function($stateProvider, $urlRouterProvider) {
    //
    $urlRouterProvider.otherwise('/auth');
  
    // 
    var authResolve = function ($q, Auth) {
      var qResolve = $q.defer();
      var AuthObj = Auth.getAuthObj();
      switch (AuthObj.authStatus) {
        case true:
          qResolve.resolve("AUTH_RESOLVE_SUCCESS");
          break
        case false:
          qResolve.reject("AUTH_RESOLVE_UNAUTHORIZED");
          break
        default: 
          qResolve.reject("AUTH_RESOLVE_OTHER", AuthObj);
          break
      };
      return qResolve.promise;
    };
  
   // REST OF .config
  
      .state('tab.album', {
      url: '/dash/:albumName',
      views: {
        'menuContent': {
          templateUrl: 'templates/tab-album.html',
          controller: 'AlbumCtrl',
          resolve: {authResolve: authResolve}
        }
      }
    })
  
  })
  </code></pre>