title: iOS how to detect if power cable is plugged
body: <p>I am making a GPS app and the accuracy changes based on if power is available (ie vehicle charger)</p>
  
  <p>Is there a way to run something in the background that constantly checks to see if a device is receiving power?</p>
  
  <p>I know how to check if power is connected. But the issue is IF the user is at home and connected. He unplugs the device to go out on a run. Then decides to hang out. My app checks the battery state on launch. How can I check it again and again. I don't want to drain his battery because he was using my app!</p>
  
  <p>We plan on only supporting iOS 5 and higher (no need for backward compatibility with iOS 4 and 3)</p>
  
  <p>Thanks</p>