This post serves as a guide for the order in which application delegate methods are invoked in response to certain actions on iOS. This information is current only for iOS 12.1 unless indicated otherwise.

Launch

  1. application(_:willFinishLaunchingWithOptions:)
  2. application(_:didFinishLaunchingWithOptions:)
  3. applicationDidBecomeActive

Open

  1. applicationWillEnterForeground
  2. applicationDidBecomeActive

Launch from URL scheme

  1. application(_:willFinishLaunchingWithOptions:)

    Example Parameters:

     {
       UIApplicationLaunchOptionsSourceApplicationKey: "com.apple.mobilesafari",
       UIApplicationLaunchOptionsURLKey: "test://test.com"
     }
    
  2. application(_:didFinishLaunchingWithOptions:)
  3. [if true is returned from 1. and 2.] application(_:open:options:)
  4. applicationDidBecomeActive

Open from URL scheme

  1. applicationWillEnterForeground
  2. application(_:open:options:)
  3. applicationDidBecomeActive
  1. application(_:willFinishLaunchingWithOptions:)

    Example Parameters:

     {
       UIApplicationLaunchOptionsUserActivityDictionaryKey: {
         UIApplicationLaunchOptionsUserActivityIdentifierKey: "F42C288E-D721-4F5D-9AB5-4FEB1D634D99",
         UIApplicationLaunchOptionsUserActivityKey: "<NSUserActivity: 0x2827146a0>",
         UIApplicationLaunchOptionsUserActivityTypeKey: NSUserActivityTypeBrowsingWeb,
       },
       UIApplicationLaunchOptionsSourceApplicationKey: "com.apple.mobilesafari"
     }
    
  2. application(_:didFinishLaunchingWithOptions:)
  3. [if true is returned from 1. and 2.] application(_:willContinueUserActivityWithType:)
  4. [if true is returned from 1. and 2.] application(_:continue:restorationHandler:)
  5. applicationDidBecomeActive
  1. applicationWillEnterForeground
  2. application(_:willContinueUserActivityWithType:):
  3. application(_:continue:restorationHandler:):
  4. applicationDidBecomeActive

Launch from push

  1. application(_:willFinishLaunchingWithOptions:)

    Example Parameters:

     {
       UIApplicationLaunchOptionsRemoteNotificationKey: {
         aps = {
           alert = "Testing.. (0)";
           badge = 1;
           sound = default;
         }
       }
     }
    
  2. application(_:didFinishLaunchingWithOptions:)
  3. userNotificationCenter(_:didReceive:withCompletionHandler:)
  4. applicationDidBecomeActive

Open from push

  1. applicationWillEnterForeground
  2. userNotificationCenter(_:didReceive:withCompletionHandler:)
  3. applicationDidBecomeActive

Launch from shortcut

  1. application(_:willFinishLaunchingWithOptions:)

    Example Parameters:

     {
       UIApplicationLaunchOptionsShortcutItemKey: <UIApplicationShortcutItem: 0x283ef6e00; type: com.recoursive.example.shortcutTest, title: Shortcut test>
     }
    
  2. application(_:didFinishLaunchingWithOptions:)
  3. [if true is returned from 1. and 2.] application(_:performActionFor:completionHandler:)
  4. applicationDidBecomeActive

Open from shortcut

  1. applicationWillEnterForeground
  2. application(_:performActionFor:completionHandler:)
  3. applicationDidBecomeActive