setNotificationQuietHours static method

Future<void> setNotificationQuietHours(
  1. String startTime,
  2. int spanMins,
  3. dynamic finished(
    1. int? code
    )?
)

全局屏蔽某个时间段的消息提醒

startTime 开始屏蔽消息提醒的时间,格式为HH:MM:SS

spanMins 需要屏蔽消息提醒的分钟数,0 < spanMins < 1440

finished 回调结果,code 为 0 代表操作成功,其他值代表失败

此方法设置的屏蔽时间会在每天该时间段时生效。

Implementation

static Future<void> setNotificationQuietHours(String startTime, int spanMins, Function(int? code)? finished) async {
  Map map = {"startTime": startTime, "spanMins": spanMins};
  int? result = await _channel.invokeMethod(RCMethodKey.SetNotificationQuietHours, map);
  if (finished != null) {
    finished(result);
  }
}