declineInvitation method
- String userId
~english Declines a friend invitation.
Param userId
The user who sends the friend invitation.
Throws A description of the exception. See ChatError. ~end
~chinese 拒绝加好友的邀请。
Param userId
发起好友邀请的用户 ID。
Throws 如果有方法调用的异常会在这里抛出,可以看到具体错误原因。请参见 ChatError。 ~end
Implementation
Future<void> declineInvitation(String userId) async {
Map req = {'username': userId};
Map result =
await _channel.invokeMethod(ChatMethodKeys.declineInvitation, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}