Config
Description
info
Initialization SDK configuration information.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
InitConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| platformID | int | Yes | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, MiniProgram 6, Linux 7 |
| apiAddr | String | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| wsAddr | String | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| dataDir | String | Yes | IM client db save directory |
| logLevel | int | No | SDK log print level |
| isLogStandardOutput | BOOL | No | Whether to print logs to the console |
| logFilePath | NSString | No | Locally save log file path |
OIMInitConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| platformID | OIMPlatform | Yes | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, MiniProgram 6, Linux 7 |
| apiAddr | NSString | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| wsAddr | NSString | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| dataDir | NSString | No | IM client db save directory |
| logLevel | NSInteger | No | SDK log print level |
| isLogStandardOutput | BOOL | No | Whether to print logs to the console |
| logFilePath | NSString | No | Locally save log file path |
InitConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| apiAddr | string | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| wsAddr | string | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| dataDir | string | Yes | IM client db save directory |
| platformID | number | No | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, MiniProgram 6, Linux 7 |
| logLevel | number | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
| logFilePath | string | No | Locally save log file path |
InitConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| platformID | Platform | Yes | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, MiniProgram 6, Linux 7 |
| apiAddr | string | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| wsAddr | string | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| dataDir | string | Yes | IM client db save directory |
| logLevel | LogLevel | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
| logFilePath | string | No | Locally save log file path |
InitConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| platformID | Platform | Yes | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB/MiniProgram 5, Linux 7 |
| apiAddr | string | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| wsAddr | string | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| dataDir | string | Yes | DB file save directory, absolute path |
| logFilePath | string | No | Log file save directory, absolute path, do not save if not passed |
| logLevel | LogLevel | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
InitAndLoginConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| platformID | Platform | Yes | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB/MiniProgram 5, Linux 7 |
| apiAddr | string | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| wsAddr | string | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| userID | string | Yes | IM User ID |
| token | string | Yes | OpenIM user token, the business backend verifies the user account and password, and calls the IM server API to obtain |
| logLevel | LogLevel | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
| tryParse | boolean | No | Whether to automatically parse the return value, default is true |
InitConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| platformID | Platform | Yes | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, MiniProgram 6, Linux 7 |
| apiAddr | string | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| wsAddr | string | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| dataDir | string | Yes | IM client db save directory |
| logLevel | LogLevel | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
| logFilePath | string | No | Locally save log file path |
IMConfig
| Field Name | Field Type | Require | Description |
|---|---|---|---|
| ApiAddr | string | Yes | IM api address, usually http://xxx:10002 or https://xxx/api |
| WsAddr | string | Yes | IM ws address, usually ws://xxx:10001 or wss://xxx/msg_gateway |
| DataDir | string | Yes | IM client db save directory |
| PlatformID | int | No | Platform ID: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, MiniProgram 6, Linux 7 |
| LogLevel | uint | No | SDK log print level |
| IsLogStandardOutput | bool | No | Whether to print logs to the console |
| LogFilePath | string | No | Locally save log file path |
| IsExternalExtensions | bool | No | Extension field |