setGroupMemberInfo
Feature Introduction
Description
Modify group member information.
Note
The group owner can modify the information of administrators and regular members; administrators can modify the information of regular members.
Relevant Callback: onGroupMemberInfoChanged
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> setGroupMemberInfo({
required GroupMembersInfo groupMembersInfo,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupMembersInfo | OIMGroupMemberInfo | Yes | Member Info |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
~ | ~ | Operation is successful if no exceptions are thrown |
Code Example
await OpenIM.iMManager.groupManager.setGroupMemberInfo(
groupMembersInfo: ,
);
// todo
Function Prototype
- (void)setGroupMemberInfo:(OIMSetGroupMemberInfo *)groupMembersInfo
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupMembersInfo | OIMSetGroupMemberInfo | Yes | Member Info |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Success return |
onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager setGroupMemberInfo:
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void setGroupMemberInfo(SetGroupMemberInfo info,OnBase<String> callBack)
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupMembersInfo | SetGroupMemberInfo | Yes | Group ID |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.setGroupMemberInfo(groupInfo, new OnBase<String>() {
@Override
public void onError(int code, String error) {
// todo: request error
}
@Override
public void onSuccess(String data) {
// todo: requset success
}
});
Function Prototype
IMSDK.setGroupMemberInfo({
groupID: string;
userID: string;
nickname?: string;
faceURL?: string;
roleLevel?: GroupMemberRole;
ex?: string;
}, operationID?: string): Promise<WsResponse>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
userID | string | Yes | User ID |
nickname | string | No | Group Member Nickname |
faceURL | string | No | Group Member Avatar |
roleLevel | string | No | Group Member Role |
ex | string | No | Group Member Extended Info |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse> | Success Callback |
Promise.catch() | Promise<WsResponse> | Failure Callback |
Code Example
import { getSDK } from '@openim/wasm-client-sdk';
const IMSDK = getSDK();
// use in electron with ffi
// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';
// const { instance: IMSDK } = getWithRenderProcess();
// use in mini program
// import { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.setGroupMemberInfo({
groupID: '',
userID: '',
nickname: 'new name',
})
.then(() => {
// Successful invocation
})
.catch(({ errCode, errMsg }) => {
// Invocation failed
});
Function Prototype
IMSDK.asyncApi('setGroupMemberInfo', operationID: string, {
groupID: string;
userID: string;
nickname?: string;
faceURL?: string;
roleLevel?: GroupMemberRole;
ex?: string;
}): Promise<void>
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for troubleshooting, should be unique, suggested to use current time and a random number |
groupID | string | Yes | Group ID |
userID | string | Yes | User ID |
nickname | string | No | Group member nickname |
faceURL | string | No | Group member avatar |
roleLevel | string | No | Group member role |
ex | string | No | Group member extended information |
Return Result
Through the
openim-uniapp-polyfill
package, the function is Promise-based. When calling, usethen
andcatch
to judge and handle successful and failed callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<void> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failed callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('setGroupMemberInfo', IMSDK.uuid(), {
groupID: '',
userID: '',
nickname: 'new name',
})
.then(() => {
// Successful invocation
})
.catch(({ errCode, errMsg }) => {
// Invocation failed
});
Function Prototype
OpenIMSDKRN.setGroupMemberInfo({
groupID: string;
userID: string;
nickname?: string;
faceURL?: string;
roleLevel?: GroupMemberRole;
ex?: string;
}, operationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
userID | string | Yes | User ID |
nickname | string | No | Group member Nickname |
faceURL | string | No | Group member avatar |
roleLevel | string | No | Group member role |
ex | string | No | Group member ex |
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<void> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.setGroupMemberInfo({
groupID: '',
userID: '',
nickname: 'new name',
}, 'operationID')
.then(() => {
// Successful invocation
})
.catch(({ errCode, errMsg }) => {
// Invocation failed
});
Function Prototype
public static void SetGroupMemberInfo(OnBase<bool> cb, SetGroupMemberInfo groupMemberInfo)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase | Yes | Callback |
groupMemberInfo | SetGroupMemberInfo | Yes | Member Setting |
Return Result
Code Example
IMSDK.SetGroupMemberInfo((suc,errCode,errMsg)=>{
},new SetGroupMemberInfo(){
});