Instance Method

disableAllBackgroundDeliveryWithCompletion:

Disables all background deliveries of update notifications.

Declaration

- (void)disableAllBackgroundDeliveryWithCompletion:(void (^)(BOOL success, NSError *error))completion;

Parameters

completion

A block that this method calls as soon as the background deliveries are disabled. This block is passed the following parameters:

success

A Boolean value. This parameter contains YES if the background deliveries were successfully disabled; otherwise, NO.

error

An error object. If an error occurred, this object contains information about the error; otherwise, it is set to nil.

Discussion

Call this method to prevent your app from receiving any additional update notifications while in the background. This method operates asynchronously. As soon as the background deliveries are disabled, this method calls its completion handler on a background queue.

See Also

Managing Background Delivery

- enableBackgroundDeliveryForType:frequency:withCompletion:

Enables the background delivery of updates.

HKUpdateFrequency

Constants that determine how often the system will launch your app in response to changes to HealthKit data.

- disableBackgroundDeliveryForType:withCompletion:

Disables background deliveries of update notifications for the specified data type.