title: iOS 7 Background Fetch When the App is Not Running
body: <p>I've written a simple application in order to test and monitor how the <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:performFetchWithCompletionHandler:" rel="nofollow noreferrer">background fetch</a> feature works in iOS7.</p>
  
  <p>First of all, I've set UIBackgroundMode options in my Info.plist file. </p>
  
  <p><img src="https://i.stack.imgur.com/DVPcg.png" alt="enter image description here"> </p>
  
  <p>Then;</p>
  
  <p>I added to below code into <strong>application:didFinishLaunchingWithOptions:</strong> method in <strong>AppDelegate.m</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/EBxZN.png" alt="enter image description here"></p>
  
  <p>At last, I've implemented the <strong>application:(UIApplication *)application 
    performFetchWithCompletionHandler:</strong> method as requested.</p>
  
  <p><img src="https://i.stack.imgur.com/mPeAr.png" alt="enter image description here"></p>
  
  <p>Every time I click <strong>Debug->Simulate Background Fetch</strong> button, it changes the application's batch number and works as expected.</p>
  
  <p>However, I've never been able to make it work when the application is not running (not even in the background mode, just not running).</p>
  
  <p>Apple says that when the application is not running and OS wants to execute the following methods respectively:</p>
  
  <pre><code>application:(UIApplication *)application didFinishLaunchingWithOptions:
  applicationDidEnterBackground:(UIApplication *)application
  application:(UIApplication *)application performFetchWithCompletionHandler:
  </code></pre>
  
  <p>So my question is that is there a way to test background fetch when the app is not running? </p>
  
  <p>I am testing this on my <strong>iPod 5th Gen with iOS 7.1</strong>.</p>