Instance Method

endBackgroundTask:

Marks the end of a specific long-running background task.

Declaration

- (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier;

Parameters

identifier

An identifier returned by the beginBackgroundTaskWithExpirationHandler: method.

Discussion

You must call this method to end a task that was started using the beginBackgroundTaskWithExpirationHandler: method. If you do not, the system may kill your app.

This method can be safely called on a non-main thread.

See Also

Managing Background Execution

backgroundRefreshStatus

Indicates whether the app can refresh content when running in the background.

UIBackgroundRefreshStatus

Constants indicating whether background execution is enabled for the app.

UIApplicationBackgroundRefreshStatusDidChangeNotification

Posted when the app’s status for downloading content in the background changes.

- beginBackgroundTaskWithName:expirationHandler:

Mark the start of a task that should continue if the app enters the background.

- beginBackgroundTaskWithExpirationHandler:

Mark the start of a task that should continue if the app enters the background.

UIBackgroundTaskIdentifier

A unique token that identifies a request to run in the background.

backgroundTimeRemaining

The maximum amount of time remaining for the app to run in the background.