Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228598

[Solved] Ionic in the background

$
0
0

Okay. I've sort of figured that all this has something to do with the lifecycle. From what I know using my debugging tool, I'm tracking the app doing these two, "Resume" and "Pause" by typing in my controller:

document.addEventListener("resume", function() {
    console.log("Resume!");
  }, false);

  document.addEventListener("pause", function() {
    console.log("Pause!");
  }, false);

I've figured out my issue using this. So I know that regardless of method of exiting the app, I will encounter "pause" and regardless of from which method you exit the app, it passes through "resume" state on the way back in. So using this two, I simply cancel my interval when it pauses and start it up again when it resumes!


Viewing all articles
Browse latest Browse all 228598

Trending Articles



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