flutter jmessage 修改群信息提示返回成功,实际上群名称并未修改

用户3047673
2020-06-05 10:37 40 1

```
Future updateGroupInfo({
@required String id,
String newName,
String newDesc,
}) async {

await _channel.invokeMethod('updateGroupInfo', 
  {
    'id': id,
    'newName': newName,
    'newDesc': newDesc
  }..removeWhere((key,value) => value == null));

return;

}
想通过这个方法修改群名称,一直修改不成功

JAVA代码少了修改群信息

private void updateGroupInfo(MethodCall call, final Result result) {
HashMap<String, Object> map = call.arguments();
long groupId;
try {
JSONObject params = new JSONObject(map);
groupId = Long.parseLong(params.getString("id"));
} catch (JSONException e) {
e.printStackTrace();
handleResult(ERR_CODE_PARAMETER, ERR_MSG_PARAMETER, result);
return;
}

JMessageClient.getGroupInfo(groupId, new GetGroupInfoCallback() {
  @Override
  public void gotResult(int status, String desc, GroupInfo groupInfo) {
    if (status == 0) {
      handleResult(toJson(groupInfo), status, desc, result);

    } else {
      handleResult(status, desc, result);
    }
  }
});

}

2个回答

热门排序