setAllReceiveMessageOptWithTimestamp method
设置全局消息接收选项
opt
全局消息接收选项,支持两种取值:
- ReceiveMsgOptEnum.V2TIM_RECEIVE_MESSAGE 在线正常接收消息,离线时会有厂商的离线推送通知,默认为该选项
- ReceiveMsgOptEnum.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE 在线正常接收消息,离线不会有推送通知,可用于实现消息免打扰功能
startTimeStamp
免打扰开始时间,UTC 时间戳,单位:秒
duration
免打扰持续时长,单位:秒
Implementation
Future<V2TimCallback> setAllReceiveMessageOptWithTimestamp({
required int opt,
required int startTimeStamp,
required int duration,
}) async {
if (kIsWeb) {
return TencentCloudChatSdkPlatform.instance
.setAllReceiveMessageOptWithTimestamp(
opt: opt, startTimeStamp: startTimeStamp, duration: duration);
}
return TIMMessageManager.instance
.setAllReceiveMessageOptWithTimestamp(
opt: opt, startTimeStamp: startTimeStamp, duration: duration);
}