changeNotificationQuietHours method

Future<int> changeNotificationQuietHours(
  1. String startTime,
  2. int spanMinutes,
  3. RCIMIWPushNotificationQuietHoursLevel level, {
  4. IRCIMIWChangeNotificationQuietHoursCallback? callback,
})

ZH

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

  • startTime 开始消息免打扰时间,格式为 HH:MM:SS
  • spanMinutes 需要消息免打扰分钟数,0 < spanMinutes < 1440( 比如,您设置的起始时间是 00:00, 结束时间为 01:00,则 spanMinutes 为 60 分钟。设置为 1439 代表全天免打扰 (23 60 + 59 = 1439 ))
  • level 消息通知级别
  • callback 事件回调。SDK 从 5.3.1 版本开始支持 callback 方式回调。从 5.4.0 版本废弃该接口的其他回调方式,预计将在 6.x 版本删除此其他回调方式。如果传入了 callback 参数,仅触发 callback 回调。
  • 返回值 当次接口操作的状态码。0 代表调用成功 具体结果需要实现接口回调,非 0 代表当前接口调用操作失败,不会触发接口回调,详细错误参考错误码
  • 接口回调 onNotificationQuietHoursChanged

EN

Mute Message Notifications for a Specific Time Period

  • startTime Specifies the start time for muting message notifications, in the format HH:MM:SS.
  • spanMinutes The duration in minutes for muting message notifications, where 0 < spanMinutes < 1440. For example, if the start time is 00:00 and the end time is 01:00, then spanMinutes would be 60. Setting it to 1439 represents a full day of muting (23 60 + 59 = 1439).
  • level The notification level for messages.
  • callback The event callback. Starting from SDK version 5.3.1, the callback method is supported. Other callback methods for this interface were deprecated in version 5.4.0 and are expected to be removed in version 6.x. If the callback parameter is provided, only the callback method will be triggered. The status code for the current operation. 0 indicates a successful call, and the specific result requires implementing the callback interface. Non-zero values indicate that the current operation failed, and the callback will not be triggered. Refer to the error codes for detailed error information.

此接口不支持 Flutter For Web 端

Implementation

Future<int> changeNotificationQuietHours(
  String startTime,
  int spanMinutes,
  RCIMIWPushNotificationQuietHoursLevel level, {
  IRCIMIWChangeNotificationQuietHoursCallback? callback,
}) async {
  return RCIMWrapperPlatform.instance.changeNotificationQuietHours(startTime, spanMinutes, level, callback: callback);
}