updateChannelMemberInfo static method
Implementation
static Future<TPMember?> updateChannelMemberInfo(
TPChannel tpChannel,
Map<String, dynamic> metaData,
{
Function(int? errorCode, String? errorMessage)? errorCallback
}) async
{
if (!_isInitialized(errorCallback: errorCallback)) { return null; }
if (!_checkAuthInfo(errorCallback: errorCallback)) { return null; }
try {
Map<String, dynamic> body = Map.from({"memberInfo": metaData});
String url = "/channels/${tpChannel.getChannelId()}/memberInfo";
Map<String, dynamic> response = await HttpUtil.postJson(url, body);
Map<String, dynamic> member = response["member"];
return TPMember(member);
} on TPException catch(e) {
Logger.log("${e.getCode()}, ${e.getMessage()}");
errorCallback?.call(e.getCode(), e.getMessage());
} catch(e){
Logger.log("$e");
errorCallback?.call(-1, e.toString());
}
return null;
}