disableBackgroundDelivery(for:withCompletion:)
Disables background deliveries of update notifications for the specified data type.
Declaration
func disableBackgroundDelivery(for type: HKObjectType, withCompletion completion: @escaping @Sendable (Bool, (any Error)?) -> Void)func disableBackgroundDelivery(for type: HKObjectType) async throwsParameters
- type:
The type of data. This object can be any concrete subclass of the Hkobjecttype class (any of the classes Hkcharacteristictype , Hkquantitytype, Hkcategorytype, Hkworkouttype or Hkcorrelationtype).
- completion:
A block that this method calls as soon as the background delivery is disabled. This block is passed the following parameters:
Discussion
Call this method to prevent your app from receiving any additional update notifications about the specified data type while in the background. This method operates asynchronously. As soon as the background delivery is disabled, this method calls its completion handler on a background queue.