addContact method
Adds a new contact.
Param userId The user to be added.
Param reason (optional) The invitation message.
Throws A description of the exception. See ChatError.
Implementation
Future<void> addContact(
String userId, {
String? reason,
}) async {
try {
Map req = {
'userId': userId,
};
req.putIfNotNull("reason", reason);
Map result = await platform_interface.Client.instance.contactManager
.callNativeMethod(ChatMethodKeys.addContact, req);
ChatError.hasErrorFromResult(result);
} catch (e) {
rethrow;
}
}