Processing queued notifications

Respond to notifications when coming out of the suspended state.

Overview

When settings or device conditions change, the system generates notifications so that apps can respond accordingly. These notifications are delivered immediately to apps that are running, but their delivery is delayed for apps that are suspended. For a suspended app, pending notifications are delivered as soon after the app begins running again (either in the foreground or in the background).

The following table lists the notifications that apps can receive after they start running again. You must explicitly add an observer to these notifications to receive them. The system coalesces multiple related notifications so that the app receives only one notification with the net changes.

Event

Notifications

The user changed your app’s preferences

Didchangenotification

The current language or locale settings changed

Currentlocaledidchangenotification

The screen mode of a display changes

Modedidchangenotification

An external display is connected or disconnected

Didconnectnotification [Image] Diddisconnectnotification

An accessory is connected or disconnected

Eaaccessorydidconnect (Swift) or Eaaccessorydidconnectnotification (Objective-C) [Image] Eaaccessorydiddisconnect (Swift) or Eaaccessorydiddisconnectnotification (Objective-C)

The status of the user’s iCloud account changed

Nsubiquityidentitydidchange

The device orientation changed

Orientationdidchangenotification [Image] (UIKit automatically updates the interface orientation of your view controllers when appropriate.)

There was a significant time change

Significanttimechangenotification

The battery level or battery state changed

Batteryleveldidchangenotification [Image] Batterystatedidchangenotification

The device’s proximity to the user changed

Proximitystatedidchangenotification

When a suspended app starts running again, the system delivers any queued notifications on the app’s main thread before it delivers any touch events or user input. Handle all notifications as quickly as possible.