deleteContact method
删除联系人 userName
keepConversation
true 保留会话和消息 false 不保留
如果添加成功,请调用onSuccess
,如果出现错误,请调用onError
。
Implementation
void deleteContact(
{String userName,
bool keepConversation = false,
onSuccess(),
onError(int code, String desc)}) {
Future<Map> result = _emContactManagerChannel.invokeMethod(
EMSDKMethod.deleteContact,
{"userName": userName, "keepConversation" : keepConversation});
result.then((response) {
if (response["success"]) {
if (onSuccess != null) onSuccess();
} else {
if (onError != null) onError(response['code'], response['desc']);
}
});
}