Note that there are some explanatory texts on larger screens.

plurals
  1. POWill iOS launch my app into the background if it was force-quit by the user?
    primarykey
    data
    text
    <p>I am triggering a background fetch by using the <code>content-available</code> flag on a push notification. I have the <code>fetch</code> and <code>remote-notification</code> <code>UIBackgroundModes</code> enabled.</p> <p>Here is the implementation I am using in my AppDelegate.m:</p> <pre><code>- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { NSLog(@"Remote Notification Recieved"); UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.alertBody = @"Looks like i got a notification - fetch thingy"; [application presentLocalNotificationNow:notification]; completionHandler(UIBackgroundFetchResultNewData); } </code></pre> <p><strong>When the app is running in the background, it works fine.</strong> (The notification is received and the app triggered the "looks like i got a notification" local notification, as the code above should do). </p> <p>However, <strong>when the app is not running</strong> and a push notification is received with the <code>content-available</code> flag, <strong>the app is not launched</strong> and the <code>didRecieveRemoteNotification</code> delegate method is never called. </p> <p>The WWDC Video <em>Whats New With Multitasking</em> (#204 from WWDC 2013) shows this: <img src="https://i.imgur.com/9OHaGys.png" alt="enter image description here"></p> <p>It says that the application is "launched into background" when a push notification is received with the <code>content-available</code> flag.</p> <p>Why is my app not launching into the background?</p> <p><strong>So the real question is:</strong></p> <p>Will iOS perform background tasks after the user has force-quit the app?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload