omikit-plugin 4.1.7 → 4.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -2
- package/android/build.gradle +1 -1
- package/omikit-plugin.podspec +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,8 +54,8 @@ The [omikit-plugin](https://www.npmjs.com/package/omikit-plugin) enables VoIP/SI
|
|
|
54
54
|
|
|
55
55
|
| Platform | SDK | Version |
|
|
56
56
|
|----------|-----|---------|
|
|
57
|
-
| Android | OMICore | 2.
|
|
58
|
-
| iOS | OmiKit | 1.11.
|
|
57
|
+
| Android | OMICore | 2.7.0 |
|
|
58
|
+
| iOS | OmiKit | 1.11.23 |
|
|
59
59
|
|
|
60
60
|
### Platform Requirements
|
|
61
61
|
|
|
@@ -1142,6 +1142,106 @@ await initCallWithUserPassword({
|
|
|
1142
1142
|
| `getSipInfo()` | `Promise<string\|null>` | SIP info (`user@realm`) |
|
|
1143
1143
|
| `getVoipToken()` | `Promise<string\|null>` | VoIP token (iOS only) |
|
|
1144
1144
|
|
|
1145
|
+
### On-Premise Endpoint Configuration (v4.1.8+) — Native Only
|
|
1146
|
+
|
|
1147
|
+
> For enterprise customers self-hosting OMI infrastructure. Override SDK default endpoints / SIP proxy / STUN / TURN with the customer's own hosts. Each field is **optional** — omit any field to keep the SDK default. Persisted natively across app relaunches.
|
|
1148
|
+
|
|
1149
|
+
**There is no JavaScript API for this feature.** Config must be set in `AppDelegate` (iOS) / `MainApplication` (Android), BEFORE React Native bootstraps. Setting from JS would race the SDK's first HTTP / SIP call (FCM token, push registration, VoIP push handler) and those requests would hit the default cloud endpoints. The native API persists the config so subsequent app launches are race-free.
|
|
1150
|
+
|
|
1151
|
+
#### iOS — `AppDelegate.m`
|
|
1152
|
+
|
|
1153
|
+
Add the call at the top of `didFinishLaunchingWithOptions:`, BEFORE the existing RN bootstrap and BEFORE any other Omi call:
|
|
1154
|
+
|
|
1155
|
+
```objc
|
|
1156
|
+
#import <OmiKit/OmiKit.h>
|
|
1157
|
+
|
|
1158
|
+
- (BOOL)application:(UIApplication *)application
|
|
1159
|
+
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
1160
|
+
|
|
1161
|
+
[OmiClient setOnPremiseInfoWithMobileSdkHost:@"omisdk.your-domain.com"
|
|
1162
|
+
callEventHost:@"call-event.your-domain.com"
|
|
1163
|
+
publicApiHost:@"public.your-domain.com"
|
|
1164
|
+
pushInfoHost:@"push-info.your-domain.com"
|
|
1165
|
+
app2AppHost:@"app-2-app.your-domain.com"
|
|
1166
|
+
logUploadHost:@"log-upload.your-domain.com"
|
|
1167
|
+
sipProxy:@"sig.your-domain.com:5222"
|
|
1168
|
+
stunServer:@"stun.your-domain.com:3478"
|
|
1169
|
+
turnServer:@"turn.your-domain.com:2222"
|
|
1170
|
+
turnUsername:@"your-turn-user"
|
|
1171
|
+
turnPassword:@"your-turn-pass"];
|
|
1172
|
+
|
|
1173
|
+
// ... existing RN bootstrap (RCTAppDelegate / RCTReactNativeFactory)
|
|
1174
|
+
}
|
|
1175
|
+
```
|
|
1176
|
+
|
|
1177
|
+
To revert: `[OmiClient clearOnPremiseInfo];`
|
|
1178
|
+
|
|
1179
|
+
#### Android — `MainApplication.kt`
|
|
1180
|
+
|
|
1181
|
+
Add the call at the top of `onCreate()`, BEFORE `SoLoader.init` and RN init:
|
|
1182
|
+
|
|
1183
|
+
```kotlin
|
|
1184
|
+
import vn.vihat.omicall.omisdk.OmiClient
|
|
1185
|
+
|
|
1186
|
+
class MainApplication : Application(), ReactApplication {
|
|
1187
|
+
override fun onCreate() {
|
|
1188
|
+
super.onCreate()
|
|
1189
|
+
|
|
1190
|
+
OmiClient.setOnPremiseInfo(
|
|
1191
|
+
this,
|
|
1192
|
+
mobileSdkHost = "omisdk.your-domain.com",
|
|
1193
|
+
callEventHost = "call-event.your-domain.com",
|
|
1194
|
+
publicApiHost = "public.your-domain.com",
|
|
1195
|
+
pushInfoHost = "push-info.your-domain.com",
|
|
1196
|
+
app2AppHost = "app-2-app.your-domain.com",
|
|
1197
|
+
logUploadHost = "log-upload.your-domain.com",
|
|
1198
|
+
sipProxy = "sig.your-domain.com:5222",
|
|
1199
|
+
stunServer = "stun.your-domain.com:3478",
|
|
1200
|
+
turnServer = "turn.your-domain.com:2222",
|
|
1201
|
+
turnUsername = "your-turn-user",
|
|
1202
|
+
turnPassword = "your-turn-pass",
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1205
|
+
SoLoader.init(this, false)
|
|
1206
|
+
// ... existing RN bootstrap
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
To revert: `OmiClient.clearOnPremiseInfo(this)`.
|
|
1212
|
+
|
|
1213
|
+
#### Field Reference
|
|
1214
|
+
|
|
1215
|
+
**HTTP host groups** (SDK replaces scheme + host only; path + query preserved 100%):
|
|
1216
|
+
|
|
1217
|
+
| Field | Replaces |
|
|
1218
|
+
|-------|----------|
|
|
1219
|
+
| `mobileSdkHost` | `omisdk-v1*.omicrm.com` — devices, extensions, network info, ICE provider, rtp log |
|
|
1220
|
+
| `callEventHost` | `call-event-v2*.omicrm.com` — call-action APIs |
|
|
1221
|
+
| `publicApiHost` | `public-v1*.omicrm.com` — init call API |
|
|
1222
|
+
| `pushInfoHost` | `push-info-v2*.omicrm.com` — has-answered |
|
|
1223
|
+
| `app2AppHost` | `app-2-app*.omicrm.com` — agent/customer login |
|
|
1224
|
+
| `logUploadHost` | `elastic-v2*.omicrm.com` — log upload |
|
|
1225
|
+
|
|
1226
|
+
**SIP / Media** (`"host:port"` format):
|
|
1227
|
+
|
|
1228
|
+
| Field | SDK default |
|
|
1229
|
+
|-------|------------|
|
|
1230
|
+
| `sipProxy` | `171.244.138.14:5222` |
|
|
1231
|
+
| `stunServer` | `stun.omicrm.com:3478` |
|
|
1232
|
+
| `turnServer` | `turn.omicrm.com:2222` |
|
|
1233
|
+
| `turnUsername` | embedded credentials |
|
|
1234
|
+
| `turnPassword` | embedded credentials |
|
|
1235
|
+
|
|
1236
|
+
#### Behavior Notes
|
|
1237
|
+
|
|
1238
|
+
- Config is **persisted** natively (iOS `NSUserDefaults` key `omicall/onpremise_config_v1`, Android `SharedPreferences` `omicall_onpremise`/`config_v1`) — no need to set on every app launch after the first.
|
|
1239
|
+
- Priority: **HTTP** → on-premise > SDK default. **SIP / Media** → on-premise > dynamic API provider > SDK default.
|
|
1240
|
+
- **Android DNS**: when on-premise is active, the SDK bypasses custom public DNS (`8.8.8.8` / `1.1.1.1`) and uses **system DNS** so internal hostnames resolve over the customer's private network / VPN. Applies to both OkHttp HTTP layer and PJSIP native.
|
|
1241
|
+
- Empty strings, null, and missing fields are treated identically as "keep SDK default" for that field.
|
|
1242
|
+
- Requires native SDK: iOS `OmiKit ≥ 1.11.23`, Android `OMICore ≥ 2.7.0`.
|
|
1243
|
+
- Backward compatible: clients that do not call `setOnPremiseInfo` see byte-for-byte identical behavior to earlier versions.
|
|
1244
|
+
|
|
1145
1245
|
### Backend Device Registration Check (v4.1.7+)
|
|
1146
1246
|
|
|
1147
1247
|
> Read-only diagnostics for verifying the local device record still exists on the OMI backend. Useful after app reinstall, account migration, or backend cleanup. The SDK **never** auto-logouts — your app decides the recovery action.
|
package/android/build.gradle
CHANGED
|
@@ -65,7 +65,7 @@ dependencies {
|
|
|
65
65
|
// OMISDK
|
|
66
66
|
implementation("androidx.work:work-runtime:2.8.1")
|
|
67
67
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
68
|
-
api "io.omicrm.vihat:omi-sdk:2.
|
|
68
|
+
api "io.omicrm.vihat:omi-sdk:2.7.0"
|
|
69
69
|
|
|
70
70
|
// React Native — resolved from consumer's node_modules
|
|
71
71
|
implementation "com.facebook.react:react-native:+"
|
package/omikit-plugin.podspec
CHANGED
|
@@ -27,7 +27,7 @@ Pod::Spec.new do |s|
|
|
|
27
27
|
s.requires_arc = true
|
|
28
28
|
|
|
29
29
|
# OmiKit binary dependency — arm64 simulator excluded due to binary compatibility
|
|
30
|
-
s.dependency "OmiKit", "1.11.
|
|
30
|
+
s.dependency "OmiKit", "1.11.23"
|
|
31
31
|
|
|
32
32
|
# Base xcconfig applied regardless of architecture
|
|
33
33
|
base_xcconfig = {
|