enableBackgroundDelivery static method

Future<bool> enableBackgroundDelivery(
  1. String identifier,
  2. UpdateFrequency frequency
)

Returns a status of calling native method for enabling background notifications about the data changing for the type with the identifier. Set the frequency to get updates on specified time interval.

Warning: not all the notifications can be provided by HealthKit on time you specify. For instance, if you provide UpdateFrequency.immediate for QuantityType.stepCount the notifications will happen hourly. Please see more here: https://developer.apple.com/documentation/healthkit/hkhealthstore/1614175-enablebackgrounddelivery

Implementation

static Future<bool> enableBackgroundDelivery(
    String identifier, UpdateFrequency frequency) async {
  final arguments = {
    'identifier': identifier,
    'frequency': frequency.value,
  };
  return await _methodChannel.invokeMethod(
      'enableBackgroundDelivery', arguments);
}