Browse SDKs · Android
SDKsAndroid

Set group extra data

Store application-defined group data in GroupInfo.ex.

Copy

GroupInfo.ex is a complete string; the SDK does not merge JSON values. Submitting a new value replaces the previous content.

GroupInfo update = new GroupInfo();
update.setGroupID(groupID);
update.setEx("{\"projectCode\":\"mobile\",\"archived\":false}");

OpenIMClient.getInstance().groupManager.setGroupInfo(update, new OnBase<String>() {
    @Override public void onSuccess(String data) { /* The request completed. */ }
    @Override public void onError(int code, String error) { /* code and error describe the failure. */ }
});

A successful callback means that the extension update request completed; it does not mean that every client has updated its UI. onGroupInfoChanged provides the updated GroupInfo. Merge it by groupID and replace the group's ex. See Group overview for the complete listener setup.