- Android
- iOS
- JavaScript
- Flutter
- ReactNative
- HarmonyOS
The SDK uses a singleton pattern and needs to be initialized only once globally.
Parameters
| Parameter | Type | Description | Minimum version |
|---|---|---|---|
| appkey | String | Unique application identifier obtained when creating an application. Data is isolated by AppKey; all clients must use the same AppKey. | 1.0.0 |
Example
List<String> serverList = new ArrayList<>();
serverList.add("wss://ws.im.com");// "wss://ws.im.com" replace with the deployed server URL
JIM.getInstance().setServerUrls(serverList);
JIM.getInstance().init(this, "appkey");
The SDK uses a singleton pattern and needs to be initialized only once globally.
Parameters
| Parameter | Type | Description | Minimum version |
|---|---|---|---|
| appKey | NSString | Unique application identifier obtained when creating an application. Data is isolated by AppKey; all clients must use the same AppKey. | 1.0.0 |
Example
[JIM.shared setServerUrls:@[@"wss://ws.im.com"]];// "wss://ws.im.com" replace with the deployed server URL
[JIM.shared initWithAppKey:@"appkey"];
The Web SDK uses a singleton pattern and needs to be initialized only once globally. Connection, conversation, and message APIs are available on the instance. For your first integration and debugging session, start with the Quick Start.
Parameters
| Parameter | Type | Required | Default | Description | Minimum version |
|---|---|---|---|---|---|
| appkey | String | Yes | None | Unique application identifier obtained when creating an application. Data is isolated between AppKeys. | 1.0.0 |
| serverList | Array | Yes | None | IM server addresses, available as the deployed Server Url. | 1.0.0 |
| isSync | Boolean | No | true | Whether to synchronize messages received while offline after connecting. Offline messages are retained for the latest 24 hours. This setting does not affect conversations or unread counts. | 1.0.0 |
| upload | Object | No | Upload component. Qiniu and Alibaba Cloud file storage are supported. See sending file messages. | 1.0.0 |
Example
let jim = JIM.init({
appkey: 'Your AppKey',
serverList: ['Server URL provided after deployment']
});
The SDK uses a singleton pattern and needs to be initialized only once globally. Before initialization, configure the server address, which is the deployed IM server address, by calling setServers before init.
Parameters
| Parameter | Type | Description | Minimum version |
|---|---|---|---|
| appkey | String | Unique application identifier obtained when creating an application. Data is isolated by AppKey; all clients must use the same AppKey. | 1.0.0 |
Example
// **Step 1:** Replace "wss://ws.im.com" with the deployed IM server address
await JuggleIm.instance.setServers(["wss://ws.im.com"]);
// **Step 2:** Call init to initialize the SDK
await JuggleIm.instance.init('appkey');
The SDK uses a singleton pattern and needs to be initialized only once globally. Configure the server address before initialization.
Parameters
| Parameter | Type | Description | Minimum version |
|---|---|---|---|
| appkey | String | Unique application identifier obtained when creating an application. Data is isolated by AppKey; all clients must use the same AppKey. | 1.0.0 |
| serverList | String[] | Server address list. | 1.0.0 |
Example
import JuggleIM from 'juggleim-rnsdk';
// **Step 1:** Set the server address list
JuggleIM.setServerUrls(['wss://ws.im.com']);
// **Step 2:** Call init to initialize the SDK
JuggleIM.init('your-appkey');
The SDK uses a singleton pattern and needs to be initialized only once globally.
| Parameter | Type | Description | Minimum version |
|---|---|---|---|
| serverUrl | string | Externally accessible persistent-connection address after server deployment. | |
| appkey | string | Unique application identifier obtained when creating an application. Data is isolated by AppKey; all clients must use the same AppKey. | 1.0.0 |
Example
JuggleIm.instance.init("{serverUrl}","{appkey}")