isJoinGroup
Description
info
Whether the current user has joined 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 Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| ~ | ~ | Operation successful if no exception thrown |
Code Example
await OpenIM.iMManager.groupManager.isJoinedGroup(
groupID: '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 Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | OIMSuccessCallback | Success |
| onFailure | OIMFailureCallback | Failure |
Code Example
[OIMManager.manager isJoinedGroup:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void isJoinGroup(OnBase<Bool> callBack)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| callBack | OnBase | Yes | Callback interface |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.dismissGroup(new OnBase<Bool>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(Bool data) {
}
},gid);
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, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| 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 { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.isJoinGroup('groupID')
.then(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
IMSDK.asyncApi('isJoinGroup', operationID: string, groupID: string): Promise<boolean>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| groupID | string | Yes | Group ID |
Return Result
Use the
openim-uniapp-polyfillpackage to make the function Promise. When calling, you need to usethenandcatchto determine and handle success and failure 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(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDK.isJoinGroup(groupID: string, operationID?: string): Promise<boolean>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | string | Yes | Group ID |
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<boolean> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.isJoinGroup('groupID')
.then(() => {
// Success
})
.catch((error) => {
// Failure
});