I'm currently just building for iOS 8+ and I'm testing on an iPhone 6, and 6S+ in the emulator. I'm using the command line to build and run, and I'm using the Cordova CLI. I've also dipped into XCode a few times to check capabilities, or fix provisioning issues.
This isn't the first app I've build using Cordova, and I've previously been able to use the resume event without issue.
I'm using document.addEventListener("resume", onResume(), false);
to fire certain functions when my app resumes. However this function is firing on first launch, and not firing at all on startup. It seems to be anytime the resume function fires it crashes my app.
I've reduced my app down to bare bones, nothing is happening in the onResume function now except the following:
function onResume() {
setTimeout(function(){
console.log('App resumed');
},0);
}
Going a little out of my mind here. I have the following plugins installed.
Managed to fix this problem, though not sure what I'd done wrong. I can only assume I must have had the wrong event name in place, or in my attempts to fix it I'd added another problem before fixing the previous one. Either way something I'd done wrong had caused the issue.
Things to check yourself:
document.addEventListener('resume', onResume, false);
event listener is in code run after device ready has fired. onResume
, not onResume()
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.