Instance Method

handleBackgroundTasks:

Tells the delegate that the app has received one or more background tasks.

Declaration

- (void)handleBackgroundTasks:(NSSet<WKRefreshBackgroundTask *> *)backgroundTasks;

Parameters

backgroundTasks

A set containing one or more background tasks.

Discussion

The system calls this method when your app is launched to handle a background task. Use this method to handle the specified tasks. Call each tasks’s setTaskCompleted method as soon as the task is complete. For more information on background tasks, see Background Refresh Tasks.

See Also

Monitoring State Changes

Working with the watchOS App Life Cycle

Learn how the watchOS app life cycle operates and respond to life cycle notification methods.

- applicationDidFinishLaunching

Tells the delegate that the launch process is almost done and the extension is almost ready to run.

- applicationDidBecomeActive

Tells the delegate that the Watch app is now visible and processing events.

- applicationWillResignActive

Tells the delegate that the Watch app is about to be deactivated.

- applicationWillEnterForeground

Tells the delegate that the app is about to transition from the background to the foreground.

- applicationDidEnterBackground

Tells the delegate that the app has transitioned from the foreground to the background.

- deviceOrientationDidChange

Tells the delegate that the device's orientation has changed.