Config
Feature Introduction
info
Initialization of SDK configuration information.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
InitConfig
| Field Name | Field Type | Mandatory | Description |
|---|---|---|---|
| platformID | int | Yes | Platform number: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, mini-program 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 storage directory |
| logLevel | int | No | SDK log print level |
| isLogStandardOutput | BOOL | No | Whether to print logs to the console |
| logFilePath | NSString | No | Local log file storage path |
OIMInitConfig
| Field Name | Field Type | Mandatory | Description |
|---|---|---|---|
| platformID | OIMPlatform | Yes | Platform number: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, mini-program 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 storage directory |
| logLevel | NSInteger | No | SDK log print level |
| isLogStandardOutput | BOOL | No | Whether to print logs to the console |
| logFilePath | NSString | No | Local log file storage path |
InitConfig
| Field Name | Field Type | Mandatory | 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 storage directory |
| platformID | number | No | Platform number: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, mini-program 6, linux 7 |
| logLevel | number | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
| logFilePath | string | No | Local log file storage path |
InitConfig
| Field Name | Field Type | Mandatory | Description |
|---|---|---|---|
| platformID | number | Yes | Platform number: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, mini-program 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 storage directory |
| logLevel | number | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
| logFilePath | string | No | Local log file storage path |
InitAndLoginConfig
| Field Name | Field Type | Mandatory | Description |
|---|---|---|---|
| platformID | Platform | Yes | Platform number: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, mini-program 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 |
| userID | string | Yes | IM user userID |
| token | string | Yes | OpenIM user token, after business backend verifies user credentials, it is obtained through user_token |
| logLevel | LogLevel | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to output logs to the console |
| tryParse | boolean | No | Whether to automatically parse the return value, default is true |
InitConfig
| Field Name | Field Type | Mandatory | Description |
|---|---|---|---|
| platformID | Platform](/sdks/enum/platform) | Yes | Platform number: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, mini-program 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 storage directory |
| logLevel | LogLevel | No | SDK log print level |
| isLogStandardOutput | boolean | No | Whether to print logs to the console |
IMConfig
| Field Name | Field Type | Mandatory | Description |
|---|---|---|---|
| PlatformID | number | Yes | Platform number: iOS 1, Android 2, Windows 3, OSX 4, WEB 5, mini-program 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 storage directory |
| LogLevel | number | No | SDK log print level |
| IsLogStandardOutput | boolean | No | Whether to print logs to the console |
| LogFilePath | string | No | Local log file storage path |