setConversationSilentMode method
Future<void>
setConversationSilentMode({
- required String conversationId,
- required EMConversationType type,
- required ChatSilentModeParam param,
~english Sets the push notifications for a conversation.
Param conversationId
The conversation ID.
Param type
The conversation type.
Param param
The offline push parameters.
Throws A description of the exception. See EMError.
~end
~chinese 设置指定会话的离线推送设置。
Param conversationId
会话 ID.
Param type
会话类型.
Param param
离线推送参数.
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 EMError。 ~end
Implementation
Future<void> setConversationSilentMode({
required String conversationId,
required EMConversationType type,
required ChatSilentModeParam param,
}) async {
Map req = {};
req["conversationId"] = conversationId;
req["conversationType"] = conversationTypeToInt(type);
req["param"] = param.toJson();
Map result = await PushChannel.invokeMethod(
ChatMethodKeys.setConversationSilentMode, req);
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}