title: Check battery level in background?
body: <p>Is it possible to check battery level in swift while our application is in background?</p>
  
  <p>Currently I am working on one iOS application in which user will be alerted with system notification when battery reached to 30%.</p>
  
  <p>I tried and I received notification randomly, sometimes 4%, sometimes 10%, mover than ever 30%.</p>
  
  <pre><code>func applicationDidEnterBackground(application: UIApplication) {
      if(UIDevice.currentDevice().batteryLevel &lt;= 0.30 &amp;&amp; UIDevice.currentDevice().batteryState != UIDeviceBatteryState.Charging)
      {
          Notification.addNotificationSystem("Mettre le portable à charger", fireDate: 1, iconBadgeNumber: false)
          }
      }
  }
  </code></pre>