disableBackgroundSync function

Future<void> disableBackgroundSync()

Experimental API On iOS, this method is a no-op. iOS HealthKit Background Delivery is an app-level entitlement, and does not require explicit user consent.

If you intend to pause or unpause synchronization, use pauseSynchronization and setPauseSynchronization(_:) instead.

Overview

Disable background sync on Android.

Implementation

Future<void> disableBackgroundSync() async {
  if (!Platform.isAndroid) {
    // iOS background delivery does not require user explicit consent.
    // It requires only the app-level HealthKit Bgnd. Delivery entitlement.
    return;
  }

  return await VitalHealthPlatform.instance.disableBackgroundSync();
}