watchOS Life Cycle Call Backs

What call backs are made to ExtensionDelegate and InterfaceController during different life cycle changes.

This was done with an Apple Watch Series 3.

Launch

  1. Precondition: app is not running.
  2. User taps app icon on Watch face.
  3. App becomes active.
ExtensionDelegate.applicationDidFinishLaunching
ExtensionDelegate.applicationWillEnterForeground
InterfaceController.awake context = nil
ExtensionDelegate.applicationDidBecomeActive
InterfaceController.willActivate
InterfaceController.didAppear

Wrist drop

  1. Precondition: app is active.
  2. User drops wrist.
  3. App is frontmost app.
  4. Watch face goes dark.
ExtensionDelegate.applicationWillResignActive
InterfaceController.didDeactivate

Wrist up

  1. Precondition: app is frontmost app.
  2. Precondition: user's wrist is down.
  3. User raises wrist.
  4. App is active.
ExtensionDelegate.applicationDidBecomeActive
InterfaceController.willActivate

Active to Dock

  1. Precondition: app is active.
  2. User clicks side button.
  3. Watch shows Dock.
  4. App is index 0 of Dock.
ExtensionDelegate.applicationWillResignActive
InterfaceController.didDeactivate
ExtensionDelegate.applicationDidEnterBackground

Face to Dock, index 1

  1. Precondition: app is index 1 of Dock.
  2. Precondition: Watch showing face.
  3. User clicks side button.
  4. Watch shows Dock.
  5. App is index 1 of Dock.
ExtensionDelegate.applicationWillEnterForeground
InterfaceController.willActivate

Face to Dock, index 0

  1. Precondition: app is index 0 of Dock.
  2. Precondition: Watch showing face.
  3. User clicks side button.
  4. Watch shows Dock.
  5. App is index 0 of Dock.
[No callbacks invoked.]

Face to Dock, last index (2 Step)

1. Face to Dock

  1. Precondition: app is in Dock at last index
  2. Watch showing face.
  3. User clicks side button.
  4. Watch shows Dock.
[No callbacks invoked.]

2. Scroll to last index in Dock

  1. Precondition: step 1 is followed.
  2. User scrolls to last index of Dock.
  3. App shows in Dock.
ExtensionDelegate.applicationWillEnterForeground
InterfaceController.willActivate

Face to Dock, not in Dock

  1. Precondition: app was active recently.
  2. Precondition: app is not in Dock
  3. Precondition: app was not manually removed from Dock.
  4. Watch showing face.
  5. User clicks side button.
  6. Watch shows Dock.
  7. User scrolls up and down entire Dock.
[No callbacks are invoked.]

Idle then Active Face (3 steps)

1. Go dark

  1. Precondition: app is active.
  2. User does nothing for a several seconds.
  3. Watch face goes dark.
  4. User does not move their wrist.
ExtensionDelegate.applicationWillResignActive
InterfaceController.didDeactivate

2. Wait

  1. Precondition: step 1 followed.
  2. User does not move wrist
  3. User waits a few minutes
ExtensionDelegate.applicationDidEnterBackground

3. Move again

  1. Precondition: step 2 followed.
  2. User taps dark Watch face.
  3. Watch shows face.
  4. Watch does not show app.
  5. User keeps Watch face active by occassional taps for a couple more minutes.
  6. App is never active.
  7. This this happens:
InterfaceController.willActivate
InterfaceController.didAppear
ExtensionDelegate.handle backgroundTasks = [ reason=4]
ExtensionDelegate.handle backgroundTasks is WKSnapshotRefreshBackgroundTask
InterfaceController.didDeactivate
InterfaceController.willDisappear

To Dock then Remove (2 step)

1. Active to Dock scroll

  1. Precondition: app is active.
  2. User presses side button.
  3. Watch shows Dock.
  4. App is at index 0 in Dock.
  5. User scrolls to top of Dock.
ExtensionDelegate.applicationWillResignActive
InterfaceController.didDeactivate
ExtensionDelegate.applicationDidEnterBackground
ExtensionDelegate.applicationWillEnterForeground
InterfaceController.willActivate

2. Remove from Dock

  1. Precondition: step 1 followed.
  2. User swipes to from off-face right to left.
  3. Watch shows red 'X' next to app in Dock.
  4. User taps red 'X'.
[No other callbacks invoked.]
[InterfaceController.deinit **not** called.]
[App is terminated.]

Not running

  1. Precondition: app is not active.
  2. User occasionally uses the Watch.
  3. A few minutes pass.
  4. User does not active the app during this time.
InterfaceController.willActivate
InterfaceController.didAppear
ExtensionDelegate.handle backgroundTasks = [ reason=4]
ExtensionDelegate.handle backgroundTasks is WKSnapshotRefreshBackgroundTask
InterfaceController.didDeactivate
InterfaceController.willDisappear