publishPresence method
- String description
~english Publishes a custom presence state.
Param description The extension information of the presence state. It can be set as nil.
Throws A description of the exception. See EMError. ~end
~chinese 发布自定义用户在线状态。
Param description 用户在线状态的扩展信息。
Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。参见 EMError。 ~end
Implementation
Future<void> publishPresence(
String description,
) async {
try {
Map req = {'desc': description};
Map result = await Client.instance.presenceManager
.callNativeMethod(ChatMethodKeys.presenceWithDescription, req);
EMError.hasErrorFromResult(result);
} catch (e) {
rethrow;
}
}