isJoinGroup
Feature Introduction
Description
Whether the current user joins a group
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<bool> isJoinedGroup({
required String groupID,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | String | Yes | Group ID |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
~ | ~ | Operation successful if no exceptions are thrown |
Code Example
await OpenIM.iMManager.groupManager.isJoinedGroup(
groupID: '',
);
// todo
Function Prototype
- (void)isJoinedGroup:(NSString *)groupID
onSuccess:(nullable OIMBoolCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | NSString | Yes | Group ID |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Success return |
onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager isJoinedGroup:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void quitGroup(OnBase<String> callBack, String gid)
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
callBack | OnBase | Yes | Callback interface |
gid | String | Yes | Group ID |
Return Results
Code Example
OpenIMClient.getInstance().groupManager.quitGroup(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
});
Function Prototype
IMSDK.isJoinGroup(groupID: string, operationID?: string): Promise<WsResponse<boolean>>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
operationID | string | No | Operation ID, which is used to locate the problem. Keep it unique. You are advised to use the current time and random number |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<boolean>> | 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.isJoinGroup('groupID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('isJoinGroup', operationID: string, groupID: string): Promise<boolean>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID for issue tracking, unique; recommended to use current time and a random number |
groupID | string | Yes | Group ID |
Return Results
The function is transformed into a Promise using the
openim-uniapp-polyfill
package. When calling, usethen
andcatch
to determine and handle successful and failed callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<boolean> | Success callback |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('isJoinGroup', IMSDK.uuid(), 'groupID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.isJoinGroup(groupID: string, operationID: string): Promise<boolean>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID for issue tracking, unique; recommended to use current time and a random number |
groupID | string | Yes | Group ID |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<boolean> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.isJoinGroup('groupID', 'operationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});