I built my Ionic / Angular application using Adobe’s PhoneGap build. This was mainly working great until recently I added some Cordova event listeners for “pause”, “resume”, etc.
Now, when I run the compiled app on my phone (with a remote debugger so I can see what is going on). It attempts to load my tab view but just stays on “pending” forever on the Network tab of the debugger. Like it’s trying to load that view but can’t do it for some reason. There is nothing in the console, even though I have console.log at the very top of my Tab view controller (the view it is trying to load).
Any ideas?
I had that same nightmare a few days ago. My app would start to load, show the default Cordova background, and then nothing but a white screen forever. Ugh…
Open up the console in Safari to inspect the app. You will probably find an AngularJS exception saying “first argument must be a function”.
I can’t remember exactly how I had the code wrong, but this is my “pause” and “resume” code:
document.addEventListener("resume", function() {
$scope.appCtrl.resetMember();
$state.go('main.home');
}, false);
document.addEventListener("pause", function() {
$scope.appCtrl.resetMember();
$state.go('main.home');
}, false);