omikit-plugin 4.0.1 → 4.0.2
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 +72 -21
- package/android/build.gradle +21 -71
- package/android/gradle.properties +4 -4
- package/android/src/main/java/com/omikitplugin/OmikitPluginModule.kt +52 -34
- package/lib/commonjs/omi_local_camera.js +14 -8
- package/lib/commonjs/omi_local_camera.js.map +1 -1
- package/lib/commonjs/omi_remote_camera.js +14 -8
- package/lib/commonjs/omi_remote_camera.js.map +1 -1
- package/lib/commonjs/omikit.js +36 -19
- package/lib/commonjs/omikit.js.map +1 -1
- package/lib/module/omi_local_camera.js +14 -8
- package/lib/module/omi_local_camera.js.map +1 -1
- package/lib/module/omi_remote_camera.js +14 -8
- package/lib/module/omi_remote_camera.js.map +1 -1
- package/lib/module/omikit.js +36 -19
- package/lib/module/omikit.js.map +1 -1
- package/package.json +1 -1
- package/src/omi_local_camera.tsx +14 -9
- package/src/omi_remote_camera.tsx +14 -9
- package/src/omikit.tsx +41 -28
package/README.md
CHANGED
|
@@ -166,11 +166,11 @@ allprojects {
|
|
|
166
166
|
Then add your credentials to `~/.gradle/gradle.properties` (or project-level `gradle.properties`):
|
|
167
167
|
|
|
168
168
|
```properties
|
|
169
|
-
OMI_USER=
|
|
170
|
-
OMI_TOKEN=
|
|
169
|
+
OMI_USER=omi_github_username
|
|
170
|
+
OMI_TOKEN=omi_github_access_token
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
> **Note:**
|
|
173
|
+
> **Note:** Contact the OMICall development team to get `OMI_USER` and `OMI_TOKEN` credentials.
|
|
174
174
|
|
|
175
175
|
### 4. New Architecture (Optional)
|
|
176
176
|
|
|
@@ -264,11 +264,11 @@ Then run `cd ios && pod install`.
|
|
|
264
264
|
│ │ │ │ │ │
|
|
265
265
|
│ ▼ │ │ ▼ │
|
|
266
266
|
│ OMIKIT SDK │ │ OmiKit SDK │
|
|
267
|
-
│ (v2.6.4)
|
|
267
|
+
│ (v2.6.4) │ │ (v1.10.34) │
|
|
268
268
|
│ │ │ │ │ │
|
|
269
269
|
│ ▼ │ │ ▼ │
|
|
270
270
|
│ SIP Stack │ │ SIP Stack │
|
|
271
|
-
│ (OMSIP)
|
|
271
|
+
│ (OMSIP) │ │ (OMSIP) │
|
|
272
272
|
└─────────────┘ └──────────────┘
|
|
273
273
|
```
|
|
274
274
|
|
|
@@ -288,7 +288,9 @@ import {
|
|
|
288
288
|
OmiCallState,
|
|
289
289
|
} from 'omikit-plugin';
|
|
290
290
|
|
|
291
|
-
// Step 1: Start SDK services
|
|
291
|
+
// Step 1: Start SDK services
|
|
292
|
+
// ⚠️ Call ONCE on app launch (e.g., in App.tsx / index.js / useEffect in root component)
|
|
293
|
+
// Do NOT call this multiple times — it initializes native audio and event listeners.
|
|
292
294
|
await startServices();
|
|
293
295
|
|
|
294
296
|
// Step 2: Login with SIP credentials
|
|
@@ -299,7 +301,7 @@ const loginResult = await initCallWithUserPassword({
|
|
|
299
301
|
host: '', // SIP proxy, defaults to vh.omicrm.com
|
|
300
302
|
isVideo: false,
|
|
301
303
|
fcmToken: 'your_fcm_token',
|
|
302
|
-
projectId: 'your_project_id', //
|
|
304
|
+
projectId: 'your_project_id', // firebase project id
|
|
303
305
|
});
|
|
304
306
|
|
|
305
307
|
// Step 3: Listen to call events
|
|
@@ -365,7 +367,7 @@ await initCallWithUserPassword({
|
|
|
365
367
|
host?: string, // SIP proxy server (optional)
|
|
366
368
|
isVideo: boolean, // Enable video capability
|
|
367
369
|
fcmToken: string, // Firebase token for push notifications
|
|
368
|
-
projectId
|
|
370
|
+
projectId: string, // Firebase project ID
|
|
369
371
|
isSkipDevices?: boolean, // true = Customer mode, false = Agent mode (default)
|
|
370
372
|
});
|
|
371
373
|
```
|
|
@@ -416,6 +418,51 @@ await initCallWithApiKey({
|
|
|
416
418
|
});
|
|
417
419
|
```
|
|
418
420
|
|
|
421
|
+
### Option 3: App-to-App API (v4.0+)
|
|
422
|
+
|
|
423
|
+
Starting from **v4.0**, customers using the **App-to-App** service must call the OMICALL API to provision SIP extensions before initializing the SDK. The API returns SIP credentials that you pass to `initCallWithUserPassword()` with `isSkipDevices: true`.
|
|
424
|
+
|
|
425
|
+
> For full API documentation (endpoints, request/response formats), see the [API Integration Guide](./docs/api-integration-guide.md).
|
|
426
|
+
|
|
427
|
+
**Quick flow:**
|
|
428
|
+
|
|
429
|
+
```
|
|
430
|
+
Your Backend OMICALL API Mobile App (SDK)
|
|
431
|
+
│ │ │
|
|
432
|
+
│ 1. POST .../init │ │
|
|
433
|
+
├─────────────────────────────►│ │
|
|
434
|
+
│ {domain, extension, │ │
|
|
435
|
+
│ password, proxy} │ │
|
|
436
|
+
│◄─────────────────────────────┤ │
|
|
437
|
+
│ │ │
|
|
438
|
+
│ 2. Return credentials │ │
|
|
439
|
+
├──────────────────────────────────────────────────────────►│
|
|
440
|
+
│ │ 3. startServices() │
|
|
441
|
+
│ │ 4. initCallWithUserPassword
|
|
442
|
+
│ │ (isSkipDevices: true) │
|
|
443
|
+
│ │ │
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
```typescript
|
|
447
|
+
// After getting credentials from your backend:
|
|
448
|
+
await startServices();
|
|
449
|
+
|
|
450
|
+
await initCallWithUserPassword({
|
|
451
|
+
userName: credentials.extension, // from API response
|
|
452
|
+
password: credentials.password, // from API response
|
|
453
|
+
realm: credentials.domain, // from API response
|
|
454
|
+
host: credentials.outboundProxy, // from API response
|
|
455
|
+
isVideo: false,
|
|
456
|
+
fcmToken: 'your-fcm-token',
|
|
457
|
+
isSkipDevices: true, // Required for App-to-App
|
|
458
|
+
});
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
> **Important:**
|
|
462
|
+
> - Call the OMICALL API from your **backend server** only — never expose the Bearer token in client-side code.
|
|
463
|
+
> - You **must** call the [Logout API](./docs/api-integration-guide.md#5-logout) before switching users. Otherwise, both devices using the same SIP extension will receive incoming calls simultaneously.
|
|
464
|
+
> - Use getter functions (`getProjectId()`, `getAppId()`, `getDeviceId()`, `getFcmToken()`, `getVoipToken()`) to retrieve device params for the [Add Device](./docs/api-integration-guide.md#4-add-device) and Logout APIs.
|
|
465
|
+
|
|
419
466
|
---
|
|
420
467
|
|
|
421
468
|
## Call Flows
|
|
@@ -470,8 +517,8 @@ await initCallWithApiKey({
|
|
|
470
517
|
│◄────────────────────┤ (event emitted) │
|
|
471
518
|
│ │ │
|
|
472
519
|
│ ┌──────────────┐ │ │
|
|
473
|
-
│ │ Show Call UI
|
|
474
|
-
│ │
|
|
520
|
+
│ │ Show Call UI │ │ │
|
|
521
|
+
│ │[Accept][Deny]│ │ │
|
|
475
522
|
│ └──────────────┘ │ │
|
|
476
523
|
│ │ │
|
|
477
524
|
│ joinCall() │ │
|
|
@@ -495,7 +542,7 @@ await initCallWithApiKey({
|
|
|
495
542
|
│ │ │◄──────────────┤
|
|
496
543
|
│ │ │ │
|
|
497
544
|
|
|
498
|
-
┌───────────────── iOS (VoIP Push)
|
|
545
|
+
┌───────────────── iOS (VoIP Push) ───────────────────┐
|
|
499
546
|
│ │ │ │ │ │
|
|
500
547
|
│ │ │ PushKit VoIP │ │ │
|
|
501
548
|
│ │ │◄──────────────┤ │ │
|
|
@@ -511,9 +558,9 @@ await initCallWithApiKey({
|
|
|
511
558
|
│ │◄──────────────┤ │ │ │
|
|
512
559
|
│ │ incoming (2) │ │ │ │
|
|
513
560
|
│ │◄──────────────┤ │ │ │
|
|
514
|
-
|
|
561
|
+
└─────────────────────────────────────────────────────┘
|
|
515
562
|
|
|
516
|
-
┌───────────────── Android (FCM)
|
|
563
|
+
┌───────────────── Android (FCM) ─────────────────────┐
|
|
517
564
|
│ │ │ │ │ │
|
|
518
565
|
│ │ │ FCM Message │ │ │
|
|
519
566
|
│ │ │◄──────────────┤ │ │
|
|
@@ -528,7 +575,7 @@ await initCallWithApiKey({
|
|
|
528
575
|
│ │◄──────────────┤ │ │ │
|
|
529
576
|
│ │ incoming (2) │ │ │ │
|
|
530
577
|
│ │◄──────────────┤ │ │ │
|
|
531
|
-
|
|
578
|
+
└─────────────────────────────────────────────────────┘
|
|
532
579
|
|
|
533
580
|
│ │ │ │
|
|
534
581
|
│ joinCall() │ │ │
|
|
@@ -558,8 +605,8 @@ await initCallWithApiKey({
|
|
|
558
605
|
│ disconnected (6) │ 200 OK │
|
|
559
606
|
│◄────────────────────┤────────────────────►│
|
|
560
607
|
│ │ │
|
|
561
|
-
│ │ Show Missed Call
|
|
562
|
-
│ │ Notification
|
|
608
|
+
│ │ Show Missed Call │
|
|
609
|
+
│ │ Notification │
|
|
563
610
|
│ │ │
|
|
564
611
|
│ (user taps notif) │ │
|
|
565
612
|
│ │ │
|
|
@@ -601,14 +648,14 @@ await initCallWithApiKey({
|
|
|
601
648
|
│ incoming (2) │ SIP INVITE │
|
|
602
649
|
│◄────────────────────┤◄────────────────────┤
|
|
603
650
|
│ │ │
|
|
604
|
-
┌── rejectCall()
|
|
651
|
+
┌── rejectCall() ───┐ │
|
|
605
652
|
│ Decline this │ 486 Busy Here │
|
|
606
|
-
│ device only
|
|
653
|
+
│ device only ├─────────────────────────► │
|
|
607
654
|
└───────────────────┘ (other devices ring) │
|
|
608
655
|
│ │ │
|
|
609
|
-
┌── dropCall()
|
|
656
|
+
┌── dropCall() ─────┐ │
|
|
610
657
|
│ Decline + stop │ 603 Decline │
|
|
611
|
-
│ ALL devices
|
|
658
|
+
│ ALL devices ├─────────────────────────► │
|
|
612
659
|
└───────────────────┘ (PBX stops all ringing) │
|
|
613
660
|
│ │ │
|
|
614
661
|
```
|
|
@@ -621,7 +668,7 @@ await initCallWithApiKey({
|
|
|
621
668
|
|
|
622
669
|
| Function | Returns | Description |
|
|
623
670
|
|----------|---------|-------------|
|
|
624
|
-
| `startServices()` | `Promise<boolean>` | Initialize SDK. Call once on app launch |
|
|
671
|
+
| `startServices()` | `Promise<boolean>` | Initialize SDK. **Call once** on app launch (e.g., `App.tsx` or `index.js`). Do not call multiple times |
|
|
625
672
|
| `initCallWithUserPassword(data)` | `Promise<boolean>` | Login with SIP username/password |
|
|
626
673
|
| `initCallWithApiKey(data)` | `Promise<boolean>` | Login with API key |
|
|
627
674
|
| `logout()` | `Promise<boolean>` | Logout and unregister SIP |
|
|
@@ -940,6 +987,8 @@ await removeVideoEvent();
|
|
|
940
987
|
|
|
941
988
|
## Push Notifications
|
|
942
989
|
|
|
990
|
+
> **Setup Guide:** To configure VoIP (iOS) and FCM (Android) for receiving incoming calls, follow the detailed guide at [OMICall Mobile SDK Setup](https://omicrm.io/post/detail/mobile-sdk-post89?lng=vi&p=BrwVVWCLGM).
|
|
991
|
+
|
|
943
992
|
### Configuration
|
|
944
993
|
|
|
945
994
|
```typescript
|
|
@@ -1169,6 +1218,7 @@ if (initialCall) {
|
|
|
1169
1218
|
| NativeEventEmitter warning (iOS) | Old RN bridge issue | Upgrade to v4.0.x with New Architecture |
|
|
1170
1219
|
| `Invalid local URI` in logs | Empty proxy/host in login | Pass `host` parameter in `initCallWithUserPassword` |
|
|
1171
1220
|
| Build error with New Arch | Codegen not configured | Ensure `codegenConfig` exists in `package.json` |
|
|
1221
|
+
| iOS Simulator build fails (arm64) | OmiKit binary does not include simulator slice | **iOS Simulator is not supported.** OmiKit SDK is device-only (`arm64` real device). Always build and test on a physical iOS device |
|
|
1172
1222
|
|
|
1173
1223
|
---
|
|
1174
1224
|
|
|
@@ -1176,6 +1226,7 @@ if (initialCall) {
|
|
|
1176
1226
|
|
|
1177
1227
|
Full documentation in [`./docs/`](./docs/):
|
|
1178
1228
|
|
|
1229
|
+
- [API Integration Guide (App-to-App)](./docs/api-integration-guide.md)
|
|
1179
1230
|
- [Project Overview & PDR](./docs/project-overview-pdr.md)
|
|
1180
1231
|
- [Codebase Summary](./docs/codebase-summary.md)
|
|
1181
1232
|
- [System Architecture](./docs/system-architecture.md)
|
package/android/build.gradle
CHANGED
|
@@ -1,45 +1,3 @@
|
|
|
1
|
-
// buildscript {
|
|
2
|
-
// // Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
-
// def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["OmikitPlugin_kotlinVersion"]
|
|
4
|
-
|
|
5
|
-
// repositories {
|
|
6
|
-
// google()
|
|
7
|
-
// mavenCentral()
|
|
8
|
-
// // maven {
|
|
9
|
-
// // url("https://vihatgroup.jfrog.io/artifactory/omi-voice/")
|
|
10
|
-
// // credentials {
|
|
11
|
-
// // username = "downloader"
|
|
12
|
-
// // password = "Omi@2022"
|
|
13
|
-
// // }
|
|
14
|
-
// // }
|
|
15
|
-
// }
|
|
16
|
-
|
|
17
|
-
// dependencies {
|
|
18
|
-
// classpath 'com.android.tools.build:gradle-api:7.1.2'
|
|
19
|
-
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
20
|
-
// classpath 'com.google.dagger:hilt-android-gradle-plugin:2.39.1'
|
|
21
|
-
// classpath 'com.github.kezong:fat-aar:1.3.8'
|
|
22
|
-
// classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.29.3"
|
|
23
|
-
// classpath 'com.android.tools.build:gradle:4.0.0'
|
|
24
|
-
// }
|
|
25
|
-
// }
|
|
26
|
-
|
|
27
|
-
buildscript {
|
|
28
|
-
ext {
|
|
29
|
-
kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["OmikitPlugin_kotlinVersion"]
|
|
30
|
-
}
|
|
31
|
-
repositories {
|
|
32
|
-
google()
|
|
33
|
-
mavenCentral()
|
|
34
|
-
}
|
|
35
|
-
dependencies {
|
|
36
|
-
classpath "com.android.tools.build:gradle:8.1.2"
|
|
37
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
38
|
-
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.39.1'
|
|
39
|
-
classpath 'com.github.kezong:fat-aar:1.3.8'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
1
|
def isNewArchitectureEnabled() {
|
|
44
2
|
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
45
3
|
}
|
|
@@ -48,7 +6,6 @@ apply plugin: 'com.android.library'
|
|
|
48
6
|
apply plugin: 'kotlin-android'
|
|
49
7
|
apply plugin: 'kotlin-parcelize'
|
|
50
8
|
|
|
51
|
-
|
|
52
9
|
if (isNewArchitectureEnabled()) {
|
|
53
10
|
apply plugin: "com.facebook.react"
|
|
54
11
|
}
|
|
@@ -70,10 +27,11 @@ android {
|
|
|
70
27
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
71
28
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
72
29
|
}
|
|
73
|
-
buildFeatures {
|
|
74
|
-
buildConfig = true
|
|
75
|
-
}
|
|
76
30
|
|
|
31
|
+
buildFeatures {
|
|
32
|
+
buildConfig = true
|
|
33
|
+
dataBinding = true
|
|
34
|
+
}
|
|
77
35
|
|
|
78
36
|
buildTypes {
|
|
79
37
|
release {
|
|
@@ -81,7 +39,7 @@ android {
|
|
|
81
39
|
}
|
|
82
40
|
}
|
|
83
41
|
|
|
84
|
-
|
|
42
|
+
lint {
|
|
85
43
|
disable "GradleCompatible"
|
|
86
44
|
}
|
|
87
45
|
|
|
@@ -90,47 +48,39 @@ android {
|
|
|
90
48
|
targetCompatibility JavaVersion.VERSION_17
|
|
91
49
|
}
|
|
92
50
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
jvmTarget = "17"
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
dataBinding {
|
|
100
|
-
enabled = true
|
|
51
|
+
kotlinOptions {
|
|
52
|
+
jvmTarget = "17"
|
|
101
53
|
}
|
|
102
54
|
}
|
|
103
55
|
|
|
104
|
-
|
|
105
56
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
dependencies {
|
|
112
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
|
|
57
|
+
kotlinOptions {
|
|
58
|
+
jvmTarget = "17"
|
|
59
|
+
}
|
|
113
60
|
}
|
|
114
61
|
|
|
115
|
-
|
|
116
|
-
|
|
117
62
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
118
63
|
|
|
119
64
|
dependencies {
|
|
120
|
-
|
|
121
|
-
// use for OMISDK
|
|
65
|
+
// OMISDK
|
|
122
66
|
implementation("androidx.work:work-runtime:2.8.1")
|
|
123
67
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
124
|
-
// api 'vn.vihat.omicall:omi-sdk:2.3.23'
|
|
125
68
|
api "io.omicrm.vihat:omi-sdk:2.6.4"
|
|
126
69
|
|
|
127
|
-
|
|
70
|
+
// React Native — resolved from consumer's node_modules
|
|
71
|
+
implementation "com.facebook.react:react-native:+"
|
|
72
|
+
|
|
73
|
+
// Kotlin
|
|
128
74
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
75
|
+
|
|
76
|
+
// UI & Android
|
|
129
77
|
implementation "com.google.android.flexbox:flexbox:3.0.0"
|
|
130
78
|
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
131
79
|
implementation "androidx.lifecycle:lifecycle-process:2.6.1"
|
|
132
80
|
implementation "com.google.android.material:material:1.9.0"
|
|
133
81
|
implementation "com.google.firebase:firebase-messaging-ktx:23.1.2"
|
|
82
|
+
|
|
83
|
+
// Network
|
|
134
84
|
implementation("com.squareup.retrofit2:retrofit:2.9.0") {
|
|
135
85
|
exclude module: 'okhttp'
|
|
136
86
|
}
|
|
@@ -140,13 +90,13 @@ dependencies {
|
|
|
140
90
|
implementation "com.squareup.okhttp3:logging-interceptor:4.9.1"
|
|
141
91
|
implementation "com.google.code.gson:gson:2.8.9"
|
|
142
92
|
|
|
143
|
-
|
|
93
|
+
// Image
|
|
144
94
|
implementation "com.squareup.picasso:picasso:2.8"
|
|
145
95
|
|
|
96
|
+
// Coroutines
|
|
146
97
|
def coroutines_version = '1.7.2'
|
|
147
98
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
|
148
99
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
|
149
|
-
|
|
150
100
|
}
|
|
151
101
|
|
|
152
102
|
if (isNewArchitectureEnabled()) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
OmikitPlugin_kotlinVersion=
|
|
1
|
+
OmikitPlugin_kotlinVersion=2.0.21
|
|
2
2
|
OmikitPlugin_minSdkVersion=24
|
|
3
|
-
OmikitPlugin_targetSdkVersion=
|
|
4
|
-
OmikitPlugin_compileSdkVersion=
|
|
5
|
-
OmikitPlugin_ndkversion=
|
|
3
|
+
OmikitPlugin_targetSdkVersion=35
|
|
4
|
+
OmikitPlugin_compileSdkVersion=35
|
|
5
|
+
OmikitPlugin_ndkversion=27.1.12297006
|
|
@@ -595,22 +595,32 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
595
595
|
return map
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
@RequiresApi(Build.VERSION_CODES.M)
|
|
599
598
|
@ReactMethod
|
|
600
599
|
fun systemAlertWindow(promise: Promise) {
|
|
600
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
601
|
+
promise.resolve(true)
|
|
602
|
+
return
|
|
603
|
+
}
|
|
601
604
|
val result = Settings.canDrawOverlays(reactApplicationContext)
|
|
602
605
|
promise.resolve(result)
|
|
603
606
|
}
|
|
604
607
|
|
|
605
|
-
@RequiresApi(Build.VERSION_CODES.M)
|
|
606
608
|
@ReactMethod
|
|
607
609
|
fun openSystemAlertSetting(promise: Promise) {
|
|
610
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
611
|
+
promise.resolve(true)
|
|
612
|
+
return
|
|
613
|
+
}
|
|
614
|
+
val ctx = reactApplicationContext ?: run {
|
|
615
|
+
promise.resolve(false)
|
|
616
|
+
return
|
|
617
|
+
}
|
|
608
618
|
val intent = Intent(
|
|
609
619
|
Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
|
|
610
|
-
Uri.parse("package:" +
|
|
620
|
+
Uri.parse("package:" + ctx.packageName)
|
|
611
621
|
)
|
|
612
622
|
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
|
613
|
-
|
|
623
|
+
ctx.startActivity(intent)
|
|
614
624
|
promise.resolve(true)
|
|
615
625
|
}
|
|
616
626
|
|
|
@@ -638,7 +648,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
638
648
|
val audioNotificationDescription = data.getString("audioNotificationDescription") ?: "Cuộc gọi audio"
|
|
639
649
|
val videoNotificationDescription = data.getString("videoNotificationDescription") ?: "Cuộc gọi video"
|
|
640
650
|
val representName = data.getString("representName") ?: ""
|
|
641
|
-
val isUserBusy = data.getBoolean("isUserBusy")
|
|
651
|
+
val isUserBusy = if (data.hasKey("isUserBusy")) data.getBoolean("isUserBusy") else false
|
|
642
652
|
|
|
643
653
|
// Configure push notification with extracted parameters
|
|
644
654
|
OmiClient.getInstance(context).configPushNotification(
|
|
@@ -682,7 +692,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
682
692
|
val password = data.getString("password")
|
|
683
693
|
val realm = data.getString("realm")
|
|
684
694
|
val host = data.getString("host").let { if (it.isNullOrEmpty()) "vh.omicrm.com" else it }
|
|
685
|
-
val isVideo = data.getBoolean("isVideo")
|
|
695
|
+
val isVideo = if (data.hasKey("isVideo")) data.getBoolean("isVideo") else false
|
|
686
696
|
val firebaseToken = data.getString("fcmToken")
|
|
687
697
|
val projectId = data.getString("projectId") ?: ""
|
|
688
698
|
val isSkipDevices = if (data.hasKey("isSkipDevices")) data.getBoolean("isSkipDevices") else false
|
|
@@ -741,7 +751,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
741
751
|
val usrName = data.getString("fullName") ?: ""
|
|
742
752
|
val usrUuid = data.getString("usrUuid") ?: ""
|
|
743
753
|
val apiKey = data.getString("apiKey") ?: ""
|
|
744
|
-
val isVideo = data.getBoolean("isVideo")
|
|
754
|
+
val isVideo = if (data.hasKey("isVideo")) data.getBoolean("isVideo") else false
|
|
745
755
|
val phone = data.getString("phone")
|
|
746
756
|
val firebaseToken = data.getString("fcmToken") ?: ""
|
|
747
757
|
val projectId = data.getString("projectId") ?: ""
|
|
@@ -898,7 +908,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
898
908
|
promise.reject("E_INVALID_PHONE", "Phone number is required")
|
|
899
909
|
return@runOnUiThread
|
|
900
910
|
}
|
|
901
|
-
val isVideo = data.getBoolean("isVideo")
|
|
911
|
+
val isVideo = if (data.hasKey("isVideo")) data.getBoolean("isVideo") else false
|
|
902
912
|
|
|
903
913
|
val startCallResult =
|
|
904
914
|
OmiClient.getInstance(reactApplicationContext!!).startCall(phoneNumber, isVideo)
|
|
@@ -930,7 +940,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
930
940
|
if (audio == PackageManager.PERMISSION_GRANTED) {
|
|
931
941
|
mainScope.launch {
|
|
932
942
|
val uuid = data.getString("usrUuid") ?: ""
|
|
933
|
-
val isVideo = data.getBoolean("isVideo")
|
|
943
|
+
val isVideo = if (data.hasKey("isVideo")) data.getBoolean("isVideo") else false
|
|
934
944
|
|
|
935
945
|
val startCallResult =
|
|
936
946
|
OmiClient.getInstance(reactApplicationContext!!).startCallWithUuid(uuid, isVideo)
|
|
@@ -1548,8 +1558,12 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1548
1558
|
// Store promise for callback
|
|
1549
1559
|
permissionPromise = promise
|
|
1550
1560
|
|
|
1561
|
+
val activity = reactApplicationContext?.currentActivity ?: run {
|
|
1562
|
+
promise.resolve(false)
|
|
1563
|
+
return
|
|
1564
|
+
}
|
|
1551
1565
|
ActivityCompat.requestPermissions(
|
|
1552
|
-
|
|
1566
|
+
activity,
|
|
1553
1567
|
missingPermissions.toTypedArray(),
|
|
1554
1568
|
REQUEST_PERMISSIONS_CODE,
|
|
1555
1569
|
)
|
|
@@ -1638,15 +1652,16 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1638
1652
|
true
|
|
1639
1653
|
}
|
|
1640
1654
|
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1655
|
+
val map: WritableMap = WritableNativeMap()
|
|
1656
|
+
map.putArray("essentialGranted", Arguments.fromList(grantedEssential.toList()))
|
|
1657
|
+
map.putArray("essentialMissing", Arguments.fromList(missingEssential.toList()))
|
|
1658
|
+
map.putBoolean("canMakeVoipCalls", missingEssential.isEmpty())
|
|
1659
|
+
val fgServiceMap: WritableMap = WritableNativeMap()
|
|
1660
|
+
foregroundServiceStatus.forEach { (k, v) -> fgServiceMap.putBoolean(k, v) }
|
|
1661
|
+
map.putMap("foregroundServicePermissions", fgServiceMap)
|
|
1662
|
+
map.putBoolean("canDrawOverlays", canDrawOverlays)
|
|
1663
|
+
map.putInt("androidVersion", Build.VERSION.SDK_INT)
|
|
1664
|
+
map.putInt("targetSdk", reactApplicationContext.applicationInfo.targetSdkVersion)
|
|
1650
1665
|
promise.resolve(map)
|
|
1651
1666
|
|
|
1652
1667
|
} catch (e: Exception) {
|
|
@@ -1721,8 +1736,12 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1721
1736
|
// Store promise for callback
|
|
1722
1737
|
permissionPromise = promise
|
|
1723
1738
|
|
|
1739
|
+
val activity = reactApplicationContext?.currentActivity ?: run {
|
|
1740
|
+
promise.reject("E_NULL_ACTIVITY", "Current activity is null")
|
|
1741
|
+
return
|
|
1742
|
+
}
|
|
1724
1743
|
ActivityCompat.requestPermissions(
|
|
1725
|
-
|
|
1744
|
+
activity,
|
|
1726
1745
|
permissionsToRequest.toTypedArray(),
|
|
1727
1746
|
REQUEST_PERMISSIONS_CODE
|
|
1728
1747
|
)
|
|
@@ -1734,19 +1753,20 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1734
1753
|
|
|
1735
1754
|
private fun requestPermission(isVideo: Boolean) {
|
|
1736
1755
|
val missingPermissions = getMissingPermissions(isVideo)
|
|
1737
|
-
|
|
1756
|
+
|
|
1738
1757
|
if (missingPermissions.isEmpty()) {
|
|
1739
1758
|
return
|
|
1740
1759
|
}
|
|
1741
|
-
|
|
1760
|
+
|
|
1761
|
+
val activity = reactApplicationContext?.currentActivity ?: return
|
|
1742
1762
|
ActivityCompat.requestPermissions(
|
|
1743
|
-
|
|
1763
|
+
activity,
|
|
1744
1764
|
missingPermissions.toTypedArray(),
|
|
1745
1765
|
REQUEST_PERMISSIONS_CODE,
|
|
1746
1766
|
)
|
|
1747
1767
|
}
|
|
1748
1768
|
|
|
1749
|
-
override fun onActivityResult(
|
|
1769
|
+
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
|
|
1750
1770
|
if (requestCode == REQUEST_OVERLAY_PERMISSION_CODE) {
|
|
1751
1771
|
val granted = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
1752
1772
|
Settings.canDrawOverlays(reactApplicationContext)
|
|
@@ -1758,14 +1778,12 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1758
1778
|
}
|
|
1759
1779
|
}
|
|
1760
1780
|
|
|
1761
|
-
override fun onNewIntent(
|
|
1762
|
-
if (
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
if (p0.getBooleanExtra(SipServiceConstants.PARAM_IS_MISSED_CALL, false)) {
|
|
1781
|
+
override fun onNewIntent(intent: Intent) {
|
|
1782
|
+
if (intent.hasExtra(SipServiceConstants.PARAM_IS_MISSED_CALL)) {
|
|
1783
|
+
if (intent.getBooleanExtra(SipServiceConstants.PARAM_IS_MISSED_CALL, false)) {
|
|
1766
1784
|
val map: WritableMap = WritableNativeMap()
|
|
1767
|
-
map.putString("callerNumber",
|
|
1768
|
-
map.putBoolean("isVideo",
|
|
1785
|
+
map.putString("callerNumber", intent.getStringExtra(SipServiceConstants.PARAM_NUMBER) ?: "")
|
|
1786
|
+
map.putBoolean("isVideo", intent.getBooleanExtra(SipServiceConstants.PARAM_IS_VIDEO, false))
|
|
1769
1787
|
sendEvent(CLICK_MISSED_CALL, map)
|
|
1770
1788
|
}
|
|
1771
1789
|
}
|
|
@@ -1916,11 +1934,11 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
1916
1934
|
val password = data.getString("password")
|
|
1917
1935
|
val realm = data.getString("realm")
|
|
1918
1936
|
val host = data.getString("host").let { if (it.isNullOrEmpty()) "vh.omicrm.com" else it }
|
|
1919
|
-
val isVideo = data.getBoolean("isVideo")
|
|
1937
|
+
val isVideo = if (data.hasKey("isVideo")) data.getBoolean("isVideo") else false
|
|
1920
1938
|
val firebaseToken = data.getString("fcmToken")
|
|
1921
1939
|
val projectId = data.getString("projectId") ?: ""
|
|
1922
|
-
val showNotification = data.getBoolean("showNotification")
|
|
1923
|
-
val enableAutoUnregister = data.getBoolean("enableAutoUnregister")
|
|
1940
|
+
val showNotification = if (data.hasKey("showNotification")) data.getBoolean("showNotification") else true
|
|
1941
|
+
val enableAutoUnregister = if (data.hasKey("enableAutoUnregister")) data.getBoolean("enableAutoUnregister") else true
|
|
1924
1942
|
|
|
1925
1943
|
// Validate required parameters
|
|
1926
1944
|
if (userName.isNullOrEmpty() || password.isNullOrEmpty() || realm.isNullOrEmpty() || firebaseToken.isNullOrEmpty()) {
|
|
@@ -6,14 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.OmiLocalCameraView = void 0;
|
|
7
7
|
exports.refreshLocalCamera = refreshLocalCamera;
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
// Safe lazy loading — requireNativeComponent can throw in bridgeless mode
|
|
10
|
+
// if the native view is not registered for Fabric
|
|
11
|
+
let _localCameraView = null;
|
|
12
|
+
const getLocalCameraView = () => {
|
|
13
|
+
if (!_localCameraView) {
|
|
14
|
+
_localCameraView = (0, _reactNative.requireNativeComponent)('FLLocalCameraView');
|
|
15
|
+
}
|
|
16
|
+
return _localCameraView;
|
|
17
|
+
};
|
|
18
|
+
const OmiLocalCameraView = exports.OmiLocalCameraView = new Proxy({}, {
|
|
19
|
+
get(_target, prop) {
|
|
20
|
+
return getLocalCameraView()[prop];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
17
23
|
|
|
18
24
|
// Module name separated from ViewManager name to avoid name collision
|
|
19
25
|
const FLLocalCamera = _reactNative.NativeModules.FLLocalCameraModule || _reactNative.NativeModules.FLLocalCameraView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_localCameraView","getLocalCameraView","requireNativeComponent","OmiLocalCameraView","exports","Proxy","get","_target","prop","FLLocalCamera","NativeModules","FLLocalCameraModule","FLLocalCameraView","refreshLocalCamera","Promise","resolve","refresh"],"sourceRoot":"../../src","sources":["omi_local_camera.tsx"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA,IAAIC,gBAAiD,GAAG,IAAI;AAC5D,MAAMC,kBAAkB,GAAGA,CAAA,KAAgC;EACzD,IAAI,CAACD,gBAAgB,EAAE;IACrBA,gBAAgB,GAAG,IAAAE,mCAAsB,EAAC,mBAAmB,CAAC;EAChE;EACA,OAAOF,gBAAgB;AACzB,CAAC;AAEM,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAIE,KAAK,CAAC,CAAC,CAAC,EAA8B;EAC1EC,GAAGA,CAACC,OAAO,EAAEC,IAAI,EAAE;IACjB,OAAQP,kBAAkB,CAAC,CAAC,CAASO,IAAI,CAAC;EAC5C;AACF,CAAC,CAAC;;AAEF;AACA,MAAMC,aAAa,GAAGC,0BAAa,CAACC,mBAAmB,IAAID,0BAAa,CAACE,iBAAiB;AACnF,SAASC,kBAAkBA,CAAA,EAAqB;EACrD,IAAI,CAACJ,aAAa,EAAE,OAAOK,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC;EACjD,OAAON,aAAa,CAACO,OAAO,CAAC,CAAC;AAChC","ignoreList":[]}
|
|
@@ -6,14 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.OmiRemoteCameraView = void 0;
|
|
7
7
|
exports.refreshRemoteCamera = refreshRemoteCamera;
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
// Safe lazy loading — requireNativeComponent can throw in bridgeless mode
|
|
10
|
+
// if the native view is not registered for Fabric
|
|
11
|
+
let _remoteCameraView = null;
|
|
12
|
+
const getRemoteCameraView = () => {
|
|
13
|
+
if (!_remoteCameraView) {
|
|
14
|
+
_remoteCameraView = (0, _reactNative.requireNativeComponent)('FLRemoteCameraView');
|
|
15
|
+
}
|
|
16
|
+
return _remoteCameraView;
|
|
17
|
+
};
|
|
18
|
+
const OmiRemoteCameraView = exports.OmiRemoteCameraView = new Proxy({}, {
|
|
19
|
+
get(_target, prop) {
|
|
20
|
+
return getRemoteCameraView()[prop];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
17
23
|
|
|
18
24
|
// Module name separated from ViewManager name to avoid name collision
|
|
19
25
|
const FLRemoteCamera = _reactNative.NativeModules.FLRemoteCameraModule || _reactNative.NativeModules.FLRemoteCameraView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_remoteCameraView","getRemoteCameraView","requireNativeComponent","OmiRemoteCameraView","exports","Proxy","get","_target","prop","FLRemoteCamera","NativeModules","FLRemoteCameraModule","FLRemoteCameraView","refreshRemoteCamera","Promise","resolve","refresh"],"sourceRoot":"../../src","sources":["omi_remote_camera.tsx"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA,IAAIC,iBAAkD,GAAG,IAAI;AAC7D,MAAMC,mBAAmB,GAAGA,CAAA,KAAgC;EAC1D,IAAI,CAACD,iBAAiB,EAAE;IACtBA,iBAAiB,GAAG,IAAAE,mCAAsB,EAAC,oBAAoB,CAAC;EAClE;EACA,OAAOF,iBAAiB;AAC1B,CAAC;AAEM,MAAMG,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAIE,KAAK,CAAC,CAAC,CAAC,EAA8B;EAC3EC,GAAGA,CAACC,OAAO,EAAEC,IAAI,EAAE;IACjB,OAAQP,mBAAmB,CAAC,CAAC,CAASO,IAAI,CAAC;EAC7C;AACF,CAAC,CAAC;;AAEF;AACA,MAAMC,cAAc,GAAGC,0BAAa,CAACC,oBAAoB,IAAID,0BAAa,CAACE,kBAAkB;AACtF,SAASC,mBAAmBA,CAAA,EAAqB;EACtD,IAAI,CAACJ,cAAc,EAAE,OAAOK,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC;EAClD,OAAON,cAAc,CAACO,OAAO,CAAC,CAAC;AACjC","ignoreList":[]}
|
package/lib/commonjs/omikit.js
CHANGED
|
@@ -56,32 +56,49 @@ const LINKING_ERROR = `The package 'omikit-plugin' doesn't seem to be linked. Ma
|
|
|
56
56
|
default: ''
|
|
57
57
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
58
58
|
|
|
59
|
-
//
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// New Architecture - use TurboModule
|
|
59
|
+
// Resolve native module: TurboModule (New Arch) → NativeModules (Old Arch) → null
|
|
60
|
+
const resolvedModule = (() => {
|
|
61
|
+
try {
|
|
62
|
+
// Try TurboModule first (New Architecture / bridgeless mode)
|
|
64
63
|
const turboModule = _reactNative.TurboModuleRegistry.get('OmikitPlugin');
|
|
65
|
-
if (turboModule)
|
|
66
|
-
|
|
64
|
+
if (turboModule) return turboModule;
|
|
65
|
+
} catch (_) {}
|
|
66
|
+
|
|
67
|
+
// Fallback to NativeModules (Old Architecture / bridge mode)
|
|
68
|
+
if (_reactNative.NativeModules.OmikitPlugin) {
|
|
69
|
+
return _reactNative.NativeModules.OmikitPlugin;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
})();
|
|
73
|
+
|
|
74
|
+
// Wrap in Proxy that throws LINKING_ERROR only when SDK methods are actually called
|
|
75
|
+
const OmikitPlugin = resolvedModule || new Proxy({}, {
|
|
76
|
+
get(_target, prop) {
|
|
77
|
+
if (prop === 'addListener' || prop === 'removeListeners') {
|
|
78
|
+
return () => {};
|
|
67
79
|
}
|
|
80
|
+
throw new Error(LINKING_ERROR);
|
|
68
81
|
}
|
|
82
|
+
});
|
|
69
83
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
84
|
+
// Setup omiEmitter — safe for Old Arch, New Arch, and bridgeless mode
|
|
85
|
+
const omiEmitter = exports.omiEmitter = (() => {
|
|
86
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
87
|
+
return _reactNative.DeviceEventEmitter;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
// Best case: NativeEventEmitter with resolved native module
|
|
91
|
+
if (resolvedModule) {
|
|
92
|
+
return new _reactNative.NativeEventEmitter(resolvedModule);
|
|
74
93
|
}
|
|
75
|
-
|
|
94
|
+
// New Arch without interop: NativeEventEmitter without module arg (RN 0.74+)
|
|
95
|
+
return new _reactNative.NativeEventEmitter();
|
|
96
|
+
} catch (_) {
|
|
97
|
+
// Last resort fallback
|
|
98
|
+
return _reactNative.DeviceEventEmitter;
|
|
99
|
+
}
|
|
76
100
|
})();
|
|
77
101
|
|
|
78
|
-
// Setup omiEmitter for iOS and Android
|
|
79
|
-
// In bridgeless mode, NativeModules is empty — use TurboModule instance instead
|
|
80
|
-
const omiEmitter = exports.omiEmitter = _reactNative.Platform.OS === 'ios' ? new _reactNative.NativeEventEmitter(_reactNative.NativeModules.OmikitPlugin ?? OmikitPlugin ?? {
|
|
81
|
-
addListener: () => {},
|
|
82
|
-
removeListeners: () => {}
|
|
83
|
-
}) : _reactNative.DeviceEventEmitter;
|
|
84
|
-
|
|
85
102
|
/**
|
|
86
103
|
* Starts the Omikit services.
|
|
87
104
|
* @returns {Promise<any>} A promise that resolves when the services start successfully.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","resolvedModule","turboModule","TurboModuleRegistry","get","_","NativeModules","OmikitPlugin","Proxy","_target","prop","Error","omiEmitter","exports","OS","DeviceEventEmitter","NativeEventEmitter","startServices","configPushNotification","data","getInitialCall","counter","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","toggleHold","onHold","sendDTMF","switchOmiCamera","toggleOmiVideo","logout","registerVideoEvent","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","rejectCall","dropCall","hideSystemNotificationSafely","hideSystemNotificationOnly","hideSystemNotificationAndUnregister","reason","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange","onRequestPermissionAndroid","checkCredentials","registerWithOptions","checkPermissionStatus","Promise","resolve","checkAndRequestPermissions","isVideo","requestSystemAlertWindowPermission","requestPermissionsByCodes","codes","getUserInfo","phone","getProjectId","getSipInfo","getAppId","getDeviceId","getFcmToken","getVoipToken"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,MAAMC,aAAa,GACjB,wEAAwE,GACxEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,cAA2B,GAAG,CAAC,MAAM;EACzC,IAAI;IACF;IACA,MAAMC,WAAW,GAAGC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC;IACjE,IAAIF,WAAW,EAAE,OAAOA,WAAW;EACrC,CAAC,CAAC,OAAOG,CAAC,EAAE,CAAC;;EAEb;EACA,IAAIC,0BAAa,CAACC,YAAY,EAAE;IAC9B,OAAOD,0BAAa,CAACC,YAAY;EACnC;EAEA,OAAO,IAAI;AACb,CAAC,EAAE,CAAC;;AAEJ;AACA,MAAMA,YAAkB,GAAGN,cAAc,IAAI,IAAIO,KAAK,CACpD,CAAC,CAAC,EACF;EACEJ,GAAGA,CAACK,OAAO,EAAEC,IAAI,EAAE;IACjB,IAAIA,IAAI,KAAK,aAAa,IAAIA,IAAI,KAAK,iBAAiB,EAAE;MACxD,OAAO,MAAM,CAAC,CAAC;IACjB;IACA,MAAM,IAAIC,KAAK,CAACf,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAED;AACA,MAAMgB,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,CAAC,MAAM;EACxB,IAAIf,qBAAQ,CAACiB,EAAE,KAAK,KAAK,EAAE;IACzB,OAAOC,+BAAkB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A;AACA;AACO,SAASC,WAAWA,CAAA,EAA2B;EACpD,OAAOvE,YAAY,CAACuE,WAAW,CAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAA,EAA2B;EACrD,OAAOxE,YAAY,CAACwE,YAAY,CAAC,CAAC;AACpC","ignoreList":[]}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { NativeModules, requireNativeComponent } from 'react-native';
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
// Safe lazy loading — requireNativeComponent can throw in bridgeless mode
|
|
4
|
+
// if the native view is not registered for Fabric
|
|
5
|
+
let _localCameraView = null;
|
|
6
|
+
const getLocalCameraView = () => {
|
|
7
|
+
if (!_localCameraView) {
|
|
8
|
+
_localCameraView = requireNativeComponent('FLLocalCameraView');
|
|
9
|
+
}
|
|
10
|
+
return _localCameraView;
|
|
11
|
+
};
|
|
12
|
+
export const OmiLocalCameraView = new Proxy({}, {
|
|
13
|
+
get(_target, prop) {
|
|
14
|
+
return getLocalCameraView()[prop];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
11
17
|
|
|
12
18
|
// Module name separated from ViewManager name to avoid name collision
|
|
13
19
|
const FLLocalCamera = NativeModules.FLLocalCameraModule || NativeModules.FLLocalCameraView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","requireNativeComponent","
|
|
1
|
+
{"version":3,"names":["NativeModules","requireNativeComponent","_localCameraView","getLocalCameraView","OmiLocalCameraView","Proxy","get","_target","prop","FLLocalCamera","FLLocalCameraModule","FLLocalCameraView","refreshLocalCamera","Promise","resolve","refresh"],"sourceRoot":"../../src","sources":["omi_local_camera.tsx"],"mappings":"AACA,SAASA,aAAa,EAAEC,sBAAsB,QAAmB,cAAc;;AAE/E;AACA;AACA,IAAIC,gBAAiD,GAAG,IAAI;AAC5D,MAAMC,kBAAkB,GAAGA,CAAA,KAAgC;EACzD,IAAI,CAACD,gBAAgB,EAAE;IACrBA,gBAAgB,GAAGD,sBAAsB,CAAC,mBAAmB,CAAC;EAChE;EACA,OAAOC,gBAAgB;AACzB,CAAC;AAED,OAAO,MAAME,kBAAkB,GAAG,IAAIC,KAAK,CAAC,CAAC,CAAC,EAA8B;EAC1EC,GAAGA,CAACC,OAAO,EAAEC,IAAI,EAAE;IACjB,OAAQL,kBAAkB,CAAC,CAAC,CAASK,IAAI,CAAC;EAC5C;AACF,CAAC,CAAC;;AAEF;AACA,MAAMC,aAAa,GAAGT,aAAa,CAACU,mBAAmB,IAAIV,aAAa,CAACW,iBAAiB;AAC1F,OAAO,SAASC,kBAAkBA,CAAA,EAAqB;EACrD,IAAI,CAACH,aAAa,EAAE,OAAOI,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC;EACjD,OAAOL,aAAa,CAACM,OAAO,CAAC,CAAC;AAChC","ignoreList":[]}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { NativeModules, requireNativeComponent } from 'react-native';
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
// Safe lazy loading — requireNativeComponent can throw in bridgeless mode
|
|
4
|
+
// if the native view is not registered for Fabric
|
|
5
|
+
let _remoteCameraView = null;
|
|
6
|
+
const getRemoteCameraView = () => {
|
|
7
|
+
if (!_remoteCameraView) {
|
|
8
|
+
_remoteCameraView = requireNativeComponent('FLRemoteCameraView');
|
|
9
|
+
}
|
|
10
|
+
return _remoteCameraView;
|
|
11
|
+
};
|
|
12
|
+
export const OmiRemoteCameraView = new Proxy({}, {
|
|
13
|
+
get(_target, prop) {
|
|
14
|
+
return getRemoteCameraView()[prop];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
11
17
|
|
|
12
18
|
// Module name separated from ViewManager name to avoid name collision
|
|
13
19
|
const FLRemoteCamera = NativeModules.FLRemoteCameraModule || NativeModules.FLRemoteCameraView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","requireNativeComponent","
|
|
1
|
+
{"version":3,"names":["NativeModules","requireNativeComponent","_remoteCameraView","getRemoteCameraView","OmiRemoteCameraView","Proxy","get","_target","prop","FLRemoteCamera","FLRemoteCameraModule","FLRemoteCameraView","refreshRemoteCamera","Promise","resolve","refresh"],"sourceRoot":"../../src","sources":["omi_remote_camera.tsx"],"mappings":"AACA,SAASA,aAAa,EAAEC,sBAAsB,QAAmB,cAAc;;AAE/E;AACA;AACA,IAAIC,iBAAkD,GAAG,IAAI;AAC7D,MAAMC,mBAAmB,GAAGA,CAAA,KAAgC;EAC1D,IAAI,CAACD,iBAAiB,EAAE;IACtBA,iBAAiB,GAAGD,sBAAsB,CAAC,oBAAoB,CAAC;EAClE;EACA,OAAOC,iBAAiB;AAC1B,CAAC;AAED,OAAO,MAAME,mBAAmB,GAAG,IAAIC,KAAK,CAAC,CAAC,CAAC,EAA8B;EAC3EC,GAAGA,CAACC,OAAO,EAAEC,IAAI,EAAE;IACjB,OAAQL,mBAAmB,CAAC,CAAC,CAASK,IAAI,CAAC;EAC7C;AACF,CAAC,CAAC;;AAEF;AACA,MAAMC,cAAc,GAAGT,aAAa,CAACU,oBAAoB,IAAIV,aAAa,CAACW,kBAAkB;AAC7F,OAAO,SAASC,mBAAmBA,CAAA,EAAqB;EACtD,IAAI,CAACH,cAAc,EAAE,OAAOI,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC;EAClD,OAAOL,cAAc,CAACM,OAAO,CAAC,CAAC;AACjC","ignoreList":[]}
|
package/lib/module/omikit.js
CHANGED
|
@@ -4,32 +4,49 @@ const LINKING_ERROR = `The package 'omikit-plugin' doesn't seem to be linked. Ma
|
|
|
4
4
|
default: ''
|
|
5
5
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// New Architecture - use TurboModule
|
|
7
|
+
// Resolve native module: TurboModule (New Arch) → NativeModules (Old Arch) → null
|
|
8
|
+
const resolvedModule = (() => {
|
|
9
|
+
try {
|
|
10
|
+
// Try TurboModule first (New Architecture / bridgeless mode)
|
|
12
11
|
const turboModule = TurboModuleRegistry.get('OmikitPlugin');
|
|
13
|
-
if (turboModule)
|
|
14
|
-
|
|
12
|
+
if (turboModule) return turboModule;
|
|
13
|
+
} catch (_) {}
|
|
14
|
+
|
|
15
|
+
// Fallback to NativeModules (Old Architecture / bridge mode)
|
|
16
|
+
if (NativeModules.OmikitPlugin) {
|
|
17
|
+
return NativeModules.OmikitPlugin;
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
})();
|
|
21
|
+
|
|
22
|
+
// Wrap in Proxy that throws LINKING_ERROR only when SDK methods are actually called
|
|
23
|
+
const OmikitPlugin = resolvedModule || new Proxy({}, {
|
|
24
|
+
get(_target, prop) {
|
|
25
|
+
if (prop === 'addListener' || prop === 'removeListeners') {
|
|
26
|
+
return () => {};
|
|
15
27
|
}
|
|
28
|
+
throw new Error(LINKING_ERROR);
|
|
16
29
|
}
|
|
30
|
+
});
|
|
17
31
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
// Setup omiEmitter — safe for Old Arch, New Arch, and bridgeless mode
|
|
33
|
+
const omiEmitter = (() => {
|
|
34
|
+
if (Platform.OS !== 'ios') {
|
|
35
|
+
return DeviceEventEmitter;
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
// Best case: NativeEventEmitter with resolved native module
|
|
39
|
+
if (resolvedModule) {
|
|
40
|
+
return new NativeEventEmitter(resolvedModule);
|
|
22
41
|
}
|
|
23
|
-
|
|
42
|
+
// New Arch without interop: NativeEventEmitter without module arg (RN 0.74+)
|
|
43
|
+
return new NativeEventEmitter();
|
|
44
|
+
} catch (_) {
|
|
45
|
+
// Last resort fallback
|
|
46
|
+
return DeviceEventEmitter;
|
|
47
|
+
}
|
|
24
48
|
})();
|
|
25
49
|
|
|
26
|
-
// Setup omiEmitter for iOS and Android
|
|
27
|
-
// In bridgeless mode, NativeModules is empty — use TurboModule instance instead
|
|
28
|
-
const omiEmitter = Platform.OS === 'ios' ? new NativeEventEmitter(NativeModules.OmikitPlugin ?? OmikitPlugin ?? {
|
|
29
|
-
addListener: () => {},
|
|
30
|
-
removeListeners: () => {}
|
|
31
|
-
}) : DeviceEventEmitter;
|
|
32
|
-
|
|
33
50
|
/**
|
|
34
51
|
* Starts the Omikit services.
|
|
35
52
|
* @returns {Promise<any>} A promise that resolves when the services start successfully.
|
package/lib/module/omikit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","NativeEventEmitter","DeviceEventEmitter","TurboModuleRegistry","LINKING_ERROR","select","ios","default","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","NativeEventEmitter","DeviceEventEmitter","TurboModuleRegistry","LINKING_ERROR","select","ios","default","resolvedModule","turboModule","get","_","OmikitPlugin","Proxy","_target","prop","Error","omiEmitter","OS","startServices","configPushNotification","data","getInitialCall","counter","initCallWithUserPassword","initCallWithApiKey","startCall","startCallWithUuid","joinCall","endCall","toggleMute","toggleSpeaker","toggleHold","onHold","sendDTMF","switchOmiCamera","toggleOmiVideo","logout","registerVideoEvent","removeVideoEvent","getCurrentUser","getGuestUser","systemAlertWindow","openSystemAlertSetting","getAudio","setAudio","getCurrentAudio","transferCall","rejectCall","dropCall","hideSystemNotificationSafely","hideSystemNotificationOnly","hideSystemNotificationAndUnregister","reason","OmiCallEvent","onCallStateChanged","onSpeaker","onMuted","onRemoteVideoReady","onClickMissedCall","onSwitchboardAnswer","onCallQuality","onAudioChange","onRequestPermissionAndroid","checkCredentials","registerWithOptions","checkPermissionStatus","Promise","resolve","checkAndRequestPermissions","isVideo","requestSystemAlertWindowPermission","requestPermissionsByCodes","codes","getUserInfo","phone","getProjectId","getSipInfo","getAppId","getDeviceId","getFcmToken","getVoipToken"],"sourceRoot":"../../src","sources":["omikit.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,kBAAkB,EAAEC,mBAAmB,QAAQ,cAAc;AAGnH,MAAMC,aAAa,GACjB,wEAAwE,GACxEJ,QAAQ,CAACK,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,cAA2B,GAAG,CAAC,MAAM;EACzC,IAAI;IACF;IACA,MAAMC,WAAW,GAAGN,mBAAmB,CAACO,GAAG,CAAO,cAAc,CAAC;IACjE,IAAID,WAAW,EAAE,OAAOA,WAAW;EACrC,CAAC,CAAC,OAAOE,CAAC,EAAE,CAAC;;EAEb;EACA,IAAIZ,aAAa,CAACa,YAAY,EAAE;IAC9B,OAAOb,aAAa,CAACa,YAAY;EACnC;EAEA,OAAO,IAAI;AACb,CAAC,EAAE,CAAC;;AAEJ;AACA,MAAMA,YAAkB,GAAGJ,cAAc,IAAI,IAAIK,KAAK,CACpD,CAAC,CAAC,EACF;EACEH,GAAGA,CAACI,OAAO,EAAEC,IAAI,EAAE;IACjB,IAAIA,IAAI,KAAK,aAAa,IAAIA,IAAI,KAAK,iBAAiB,EAAE;MACxD,OAAO,MAAM,CAAC,CAAC;IACjB;IACA,MAAM,IAAIC,KAAK,CAACZ,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAED;AACA,MAAMa,UAAU,GAAG,CAAC,MAAM;EACxB,IAAIjB,QAAQ,CAACkB,EAAE,KAAK,KAAK,EAAE;IACzB,OAAOhB,kBAAkB;EAC3B;EACA,IAAI;IACF;IACA,IAAIM,cAAc,EAAE;MAClB,OAAO,IAAIP,kBAAkB,CAACO,cAAqB,CAA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,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAA2B;EACpD,OAAOnE,YAAY,CAACmE,WAAW,CAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAA2B;EACpD,OAAOpE,YAAY,CAACoE,WAAW,CAAC,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAA2B;EACrD,OAAOrE,YAAY,CAACqE,YAAY,CAAC,CAAC;AACpC","ignoreList":[]}
|
package/package.json
CHANGED
package/src/omi_local_camera.tsx
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { HostComponent } from 'react-native';
|
|
2
2
|
import { NativeModules, requireNativeComponent, ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
// Safe lazy loading — requireNativeComponent can throw in bridgeless mode
|
|
5
|
+
// if the native view is not registered for Fabric
|
|
6
|
+
let _localCameraView: HostComponent<ViewProps> | null = null;
|
|
7
|
+
const getLocalCameraView = (): HostComponent<ViewProps> => {
|
|
8
|
+
if (!_localCameraView) {
|
|
9
|
+
_localCameraView = requireNativeComponent('FLLocalCameraView');
|
|
10
|
+
}
|
|
11
|
+
return _localCameraView;
|
|
12
|
+
};
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
export const OmiLocalCameraView = new Proxy({} as HostComponent<ViewProps>, {
|
|
15
|
+
get(_target, prop) {
|
|
16
|
+
return (getLocalCameraView() as any)[prop];
|
|
17
|
+
},
|
|
18
|
+
});
|
|
14
19
|
|
|
15
20
|
// Module name separated from ViewManager name to avoid name collision
|
|
16
21
|
const FLLocalCamera = NativeModules.FLLocalCameraModule || NativeModules.FLLocalCameraView;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { HostComponent } from 'react-native';
|
|
2
2
|
import { NativeModules, requireNativeComponent, ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
// Safe lazy loading — requireNativeComponent can throw in bridgeless mode
|
|
5
|
+
// if the native view is not registered for Fabric
|
|
6
|
+
let _remoteCameraView: HostComponent<ViewProps> | null = null;
|
|
7
|
+
const getRemoteCameraView = (): HostComponent<ViewProps> => {
|
|
8
|
+
if (!_remoteCameraView) {
|
|
9
|
+
_remoteCameraView = requireNativeComponent('FLRemoteCameraView');
|
|
10
|
+
}
|
|
11
|
+
return _remoteCameraView;
|
|
12
|
+
};
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
export const OmiRemoteCameraView = new Proxy({} as HostComponent<ViewProps>, {
|
|
15
|
+
get(_target, prop) {
|
|
16
|
+
return (getRemoteCameraView() as any)[prop];
|
|
17
|
+
},
|
|
18
|
+
});
|
|
14
19
|
|
|
15
20
|
// Module name separated from ViewManager name to avoid name collision
|
|
16
21
|
const FLRemoteCamera = NativeModules.FLRemoteCameraModule || NativeModules.FLRemoteCameraView;
|
package/src/omikit.tsx
CHANGED
|
@@ -7,39 +7,52 @@ const LINKING_ERROR =
|
|
|
7
7
|
'- You rebuilt the app after installing the package\n' +
|
|
8
8
|
'- You are not using Expo Go\n';
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (isTurboModuleEnabled) {
|
|
15
|
-
// New Architecture - use TurboModule
|
|
10
|
+
// Resolve native module: TurboModule (New Arch) → NativeModules (Old Arch) → null
|
|
11
|
+
const resolvedModule: Spec | null = (() => {
|
|
12
|
+
try {
|
|
13
|
+
// Try TurboModule first (New Architecture / bridgeless mode)
|
|
16
14
|
const turboModule = TurboModuleRegistry.get<Spec>('OmikitPlugin');
|
|
17
|
-
if (turboModule)
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
if (turboModule) return turboModule;
|
|
16
|
+
} catch (_) {}
|
|
17
|
+
|
|
18
|
+
// Fallback to NativeModules (Old Architecture / bridge mode)
|
|
19
|
+
if (NativeModules.OmikitPlugin) {
|
|
20
|
+
return NativeModules.OmikitPlugin;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
return NativeModules.OmikitPlugin || new Proxy(
|
|
24
|
-
{},
|
|
25
|
-
{
|
|
26
|
-
get() {
|
|
27
|
-
throw new Error(LINKING_ERROR);
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
);
|
|
23
|
+
return null;
|
|
31
24
|
})();
|
|
32
25
|
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
// Wrap in Proxy that throws LINKING_ERROR only when SDK methods are actually called
|
|
27
|
+
const OmikitPlugin: Spec = resolvedModule || new Proxy(
|
|
28
|
+
{} as Spec,
|
|
29
|
+
{
|
|
30
|
+
get(_target, prop) {
|
|
31
|
+
if (prop === 'addListener' || prop === 'removeListeners') {
|
|
32
|
+
return () => {};
|
|
33
|
+
}
|
|
34
|
+
throw new Error(LINKING_ERROR);
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// Setup omiEmitter — safe for Old Arch, New Arch, and bridgeless mode
|
|
40
|
+
const omiEmitter = (() => {
|
|
41
|
+
if (Platform.OS !== 'ios') {
|
|
42
|
+
return DeviceEventEmitter;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
// Best case: NativeEventEmitter with resolved native module
|
|
46
|
+
if (resolvedModule) {
|
|
47
|
+
return new NativeEventEmitter(resolvedModule as any);
|
|
48
|
+
}
|
|
49
|
+
// New Arch without interop: NativeEventEmitter without module arg (RN 0.74+)
|
|
50
|
+
return new NativeEventEmitter();
|
|
51
|
+
} catch (_) {
|
|
52
|
+
// Last resort fallback
|
|
53
|
+
return DeviceEventEmitter;
|
|
54
|
+
}
|
|
55
|
+
})();
|
|
43
56
|
|
|
44
57
|
/**
|
|
45
58
|
* Starts the Omikit services.
|