omikit-plugin 3.2.38 → 3.2.40
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 +99 -71
- package/android/build.gradle +3 -3
- package/android/gradle.properties +2 -0
- package/android/settings.gradle +2 -2
- package/android/src/main/java/com/omikitplugin/OmikitPluginModule.kt +22 -14
- package/ios/CallProcess/CallManager.swift +6 -0
- package/omikit-plugin.podspec +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,13 +17,13 @@ Currently active maintenance and improve performance
|
|
|
17
17
|
|
|
18
18
|
Install via npm:
|
|
19
19
|
|
|
20
|
-
```
|
|
20
|
+
```ruby
|
|
21
21
|
npm install omikit-plugin@latest
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Install via yarn:
|
|
25
25
|
|
|
26
|
-
```
|
|
26
|
+
```ruby
|
|
27
27
|
yarn add omikit-plugin --latest
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -33,26 +33,35 @@ yarn add omikit-plugin --latest
|
|
|
33
33
|
|
|
34
34
|
- Add these settings in `build.gradle`:
|
|
35
35
|
|
|
36
|
-
```
|
|
36
|
+
```kotlin
|
|
37
37
|
jcenter()
|
|
38
38
|
maven {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
username = "
|
|
42
|
-
password = "
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
url "https://maven.pkg.github.com/omicall/OMICall-SDK"
|
|
40
|
+
credentials {
|
|
41
|
+
username = project.findProperty("OMI_USER") ?: ""
|
|
42
|
+
password = project.findProperty("OMI_TOKEN") ?: ""
|
|
43
|
+
}
|
|
44
|
+
authentication {
|
|
45
|
+
basic(BasicAuthentication)
|
|
46
|
+
}
|
|
47
47
|
}
|
|
48
|
-
```
|
|
49
48
|
|
|
49
|
+
dependencies {
|
|
50
|
+
api 'vn.vihat.omicall:omi-sdk:2.3.12'
|
|
51
|
+
}
|
|
50
52
|
```
|
|
53
|
+
```kotlin
|
|
54
|
+
// gradle.properties
|
|
55
|
+
OMI_USER=omicall
|
|
56
|
+
OMI_TOKEN=${OMI_TOKEN} // connect with dev off OMI for get token
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```kotlin
|
|
51
60
|
// in dependencies
|
|
52
61
|
classpath 'com.google.gms:google-services:4.3.13'
|
|
53
62
|
```
|
|
54
63
|
|
|
55
|
-
```
|
|
64
|
+
```kotlin
|
|
56
65
|
// under buildscript
|
|
57
66
|
allprojects {
|
|
58
67
|
repositories {
|
|
@@ -73,15 +82,15 @@ allprojects {
|
|
|
73
82
|
}
|
|
74
83
|
google()
|
|
75
84
|
maven { url 'https://www.jitpack.io' }
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
maven {
|
|
86
|
+
url "https://maven.pkg.github.com/omicall/OMICall-SDK"
|
|
87
|
+
credentials {
|
|
88
|
+
username = project.findProperty("OMI_USER") ?: ""
|
|
89
|
+
password = project.findProperty("OMI_TOKEN") ?: ""
|
|
90
|
+
}
|
|
91
|
+
authentication {
|
|
92
|
+
basic(BasicAuthentication)
|
|
93
|
+
}
|
|
85
94
|
}
|
|
86
95
|
}
|
|
87
96
|
}
|
|
@@ -91,7 +100,7 @@ You can refer <a href="https://github.com/VIHATTeam/OMICALL-React-Native-SDK/blo
|
|
|
91
100
|
|
|
92
101
|
- Add these settings in `app/build.gradle`:
|
|
93
102
|
|
|
94
|
-
```
|
|
103
|
+
```kotlin
|
|
95
104
|
apply plugin: 'com.android.application'
|
|
96
105
|
apply plugin: 'com.google.gms.google-services'
|
|
97
106
|
```
|
|
@@ -100,7 +109,7 @@ You can refer <a href="https://github.com/VIHATTeam/OMICALL-React-Native-SDK/blo
|
|
|
100
109
|
|
|
101
110
|
- Update AndroidManifest.xml:
|
|
102
111
|
|
|
103
|
-
```
|
|
112
|
+
```kotlin
|
|
104
113
|
<manifest
|
|
105
114
|
......
|
|
106
115
|
xmlns:tools="http://schemas.android.com/tools">
|
|
@@ -174,7 +183,7 @@ You can refer <a href="https://github.com/VIHATTeam/OMICALL-React-Native-SDK/blo
|
|
|
174
183
|
|
|
175
184
|
##### In file MainActivity:
|
|
176
185
|
|
|
177
|
-
```
|
|
186
|
+
```java
|
|
178
187
|
public class MainActivity extends ReactActivity {
|
|
179
188
|
..... // your config
|
|
180
189
|
|
|
@@ -221,7 +230,7 @@ public class MainActivity extends ReactActivity {
|
|
|
221
230
|
|
|
222
231
|
- Add variables in **Appdelegate.h** for **Old Architecture**:
|
|
223
232
|
|
|
224
|
-
```
|
|
233
|
+
```objective-c
|
|
225
234
|
#import <UIKit/UIKit.h>
|
|
226
235
|
#import <UserNotifications/UserNotifications.h>
|
|
227
236
|
#import <OmiKit/OmiKit-umbrella.h>
|
|
@@ -239,7 +248,7 @@ public class MainActivity extends ReactActivity {
|
|
|
239
248
|
|
|
240
249
|
- Add variables in **Appdelegate.h** for **New Architecture**:
|
|
241
250
|
|
|
242
|
-
```
|
|
251
|
+
```objective-c
|
|
243
252
|
#import <UIKit/UIKit.h>
|
|
244
253
|
#import <UserNotifications/UserNotifications.h>
|
|
245
254
|
#import <OmiKit/OmiKit-umbrella.h>
|
|
@@ -258,7 +267,7 @@ public class MainActivity extends ReactActivity {
|
|
|
258
267
|
|
|
259
268
|
- Edit AppDelegate.m:
|
|
260
269
|
|
|
261
|
-
```
|
|
270
|
+
```objective-c
|
|
262
271
|
#import <OmiKit/OmiKit.h>
|
|
263
272
|
|
|
264
273
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
@@ -309,7 +318,7 @@ public class MainActivity extends ReactActivity {
|
|
|
309
318
|
|
|
310
319
|
- Add these lines into `Info.plist`:
|
|
311
320
|
|
|
312
|
-
```
|
|
321
|
+
```swift
|
|
313
322
|
<key>NSMicrophoneUsageDescription</key>
|
|
314
323
|
<string>Need microphone access for make Call</string>
|
|
315
324
|
//If you implement video call
|
|
@@ -319,7 +328,7 @@ public class MainActivity extends ReactActivity {
|
|
|
319
328
|
|
|
320
329
|
- Save token for `OmiClient`: if You added `Cloud Messaging` in your project so you don't need add these lines.
|
|
321
330
|
|
|
322
|
-
```
|
|
331
|
+
```swift
|
|
323
332
|
- (void)application:(UIApplication*)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)devToken
|
|
324
333
|
{
|
|
325
334
|
// parse token bytes to string
|
|
@@ -363,7 +372,7 @@ We support 2 environments. So you need set correct key in Appdelegate.
|
|
|
363
372
|
|
|
364
373
|
- Add variables in Appdelegate.swift:
|
|
365
374
|
|
|
366
|
-
```
|
|
375
|
+
```swift
|
|
367
376
|
import OmiKit
|
|
368
377
|
import PushKit
|
|
369
378
|
import NotificationCenter
|
|
@@ -375,7 +384,7 @@ var voipRegistry: PKPushRegistry?
|
|
|
375
384
|
|
|
376
385
|
- Add these lines into `didFinishLaunchingWithOptions`:
|
|
377
386
|
|
|
378
|
-
```
|
|
387
|
+
```swift
|
|
379
388
|
OmiClient.setEnviroment(KEY_OMI_APP_ENVIROMENT_SANDBOX, userNameKey: "extension", maxCall: 1, callKitImage: "call_image")
|
|
380
389
|
provider = CallKitProviderDelegate.init(callManager: OMISIPLib.sharedInstance().callManager)
|
|
381
390
|
voipRegistry = PKPushRegistry.init(queue: .main)
|
|
@@ -384,7 +393,7 @@ pushkitManager = PushKitManager.init(voipRegistry: voipRegistry)
|
|
|
384
393
|
|
|
385
394
|
- Add these lines into `Info.plist`:
|
|
386
395
|
|
|
387
|
-
```
|
|
396
|
+
```swift
|
|
388
397
|
<key>NSCameraUsageDescription</key>
|
|
389
398
|
<string>Need camera access for video call functions</string>
|
|
390
399
|
<key>NSMicrophoneUsageDescription</key>
|
|
@@ -393,7 +402,7 @@ pushkitManager = PushKitManager.init(voipRegistry: voipRegistry)
|
|
|
393
402
|
|
|
394
403
|
- Save token for `OmiClient`: if you added `firebase_messaging` in your project so you don't need add these lines.
|
|
395
404
|
|
|
396
|
-
```
|
|
405
|
+
```swift
|
|
397
406
|
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
|
398
407
|
let deviceTokenString = deviceToken.hexString
|
|
399
408
|
OmiClient.setUserPushNotificationToken(deviceTokenString)
|
|
@@ -456,7 +465,7 @@ We need you request permission about call before make call:
|
|
|
456
465
|
|
|
457
466
|
- Start Serivce: OmiKit need start services and register some events.
|
|
458
467
|
|
|
459
|
-
```
|
|
468
|
+
```javascript
|
|
460
469
|
//Call in the root widget
|
|
461
470
|
import { startServices } from 'omikit-plugin';
|
|
462
471
|
|
|
@@ -469,7 +478,7 @@ We need you request permission about call before make call:
|
|
|
469
478
|
Please contact for my sale:
|
|
470
479
|
In This step, we need partner provide me fcmToken of firebase Message.
|
|
471
480
|
|
|
472
|
-
```
|
|
481
|
+
```javascript
|
|
473
482
|
import { initCallWithApiKey } from 'omikit-plugin';
|
|
474
483
|
import messaging from '@react-native-firebase/messaging';
|
|
475
484
|
|
|
@@ -487,6 +496,7 @@ We need you request permission about call before make call:
|
|
|
487
496
|
phone: phone,
|
|
488
497
|
fcmToken: token, //with android is fcm_token and ios is APNS token
|
|
489
498
|
isVideo: isVideo,
|
|
499
|
+
projectId: projectId // firebase project id off your
|
|
490
500
|
};
|
|
491
501
|
const result = await initCallWithApiKey(loginInfo);
|
|
492
502
|
//result is true then user login successfully.
|
|
@@ -496,7 +506,7 @@ We need you request permission about call before make call:
|
|
|
496
506
|
This function is used when you want to call any telecommunication number, calling back and forth between internal groups.
|
|
497
507
|
Please contact for my sale:
|
|
498
508
|
|
|
499
|
-
```
|
|
509
|
+
```javascript
|
|
500
510
|
import { initCallWithUserPassword } from 'omikit-plugin';
|
|
501
511
|
import messaging from '@react-native-firebase/messaging';
|
|
502
512
|
|
|
@@ -512,7 +522,8 @@ We need you request permission about call before make call:
|
|
|
512
522
|
password: password, //string
|
|
513
523
|
realm: realm, //string
|
|
514
524
|
isVideo: isVideo, //boolean: true/false
|
|
515
|
-
fcmToken: token, //with android is fcm_token and ios is APNS token
|
|
525
|
+
fcmToken: token, //with android is fcm_token and ios is APNS token,
|
|
526
|
+
projectId: projectId // firebase project id off your
|
|
516
527
|
};
|
|
517
528
|
const result = await initCallWithUserPassword(loginInfo);
|
|
518
529
|
//result is true then user login successfully.
|
|
@@ -520,7 +531,7 @@ We need you request permission about call before make call:
|
|
|
520
531
|
|
|
521
532
|
- Config push notification:
|
|
522
533
|
|
|
523
|
-
```
|
|
534
|
+
```javascript
|
|
524
535
|
import { configPushNotification } from 'omikit-plugin';
|
|
525
536
|
|
|
526
537
|
configPushNotification({
|
|
@@ -558,7 +569,7 @@ We need you request permission about call before make call:
|
|
|
558
569
|
|
|
559
570
|
- Call with phone number (mobile phone or internal number):
|
|
560
571
|
|
|
561
|
-
```
|
|
572
|
+
```javascript
|
|
562
573
|
import {startCall} from 'omikit-plugin';
|
|
563
574
|
const result = await startCall({
|
|
564
575
|
phoneNumber: phone, //phone number
|
|
@@ -568,7 +579,7 @@ We need you request permission about call before make call:
|
|
|
568
579
|
|
|
569
580
|
- The result will be in the form of object:
|
|
570
581
|
|
|
571
|
-
```
|
|
582
|
+
```javascript
|
|
572
583
|
result = {
|
|
573
584
|
"_id": String // This is call_id. it just have id for iOS,
|
|
574
585
|
"status": Number // This is result code when make,
|
|
@@ -578,7 +589,7 @@ We need you request permission about call before make call:
|
|
|
578
589
|
|
|
579
590
|
- Describe in detail the results when startCall returns:
|
|
580
591
|
|
|
581
|
-
```
|
|
592
|
+
```javascript
|
|
582
593
|
+ message="INVALID_UUID" (status = 0) : uid is invalid (we can not find on my page).
|
|
583
594
|
+ message="INVALID_PHONE_NUMBER" (status = 1) : sip user is invalid.
|
|
584
595
|
+ message="SAME_PHONE_NUMBER_WITH_PHONE_REGISTER" (status = 2) : Can not call same phone number.
|
|
@@ -594,7 +605,7 @@ We need you request permission about call before make call:
|
|
|
594
605
|
|
|
595
606
|
- Call with UUID (only support with Api key):
|
|
596
607
|
|
|
597
|
-
```
|
|
608
|
+
```javascript
|
|
598
609
|
import {startCallWithUuid} from 'omikit-plugin';
|
|
599
610
|
const result = await startCallWithUuid({
|
|
600
611
|
usrUuid: uuid, //phone number
|
|
@@ -605,7 +616,7 @@ We need you request permission about call before make call:
|
|
|
605
616
|
|
|
606
617
|
- Accept a call:
|
|
607
618
|
|
|
608
|
-
```
|
|
619
|
+
```javascript
|
|
609
620
|
import {joinCall} from 'omikit-plugin';
|
|
610
621
|
|
|
611
622
|
await joinCall();
|
|
@@ -613,7 +624,7 @@ We need you request permission about call before make call:
|
|
|
613
624
|
|
|
614
625
|
- End a call: We will push a event `endCall` for you.
|
|
615
626
|
|
|
616
|
-
```
|
|
627
|
+
```javascript
|
|
617
628
|
import {endCall} from 'omikit-plugin';
|
|
618
629
|
|
|
619
630
|
const value = await endCall();
|
|
@@ -633,7 +644,7 @@ We need you request permission about call before make call:
|
|
|
633
644
|
|
|
634
645
|
- Toggle the audio: On/off audio a call
|
|
635
646
|
|
|
636
|
-
```
|
|
647
|
+
```javascript
|
|
637
648
|
import {toggleMute} from 'omikit-plugin';
|
|
638
649
|
|
|
639
650
|
toggleMute();
|
|
@@ -641,7 +652,7 @@ We need you request permission about call before make call:
|
|
|
641
652
|
|
|
642
653
|
- Toggle the speaker: On/off the phone speaker
|
|
643
654
|
|
|
644
|
-
```
|
|
655
|
+
```javascript
|
|
645
656
|
import {toggleSpeaker} from 'omikit-plugin';
|
|
646
657
|
|
|
647
658
|
toggleSpeaker();
|
|
@@ -649,7 +660,7 @@ We need you request permission about call before make call:
|
|
|
649
660
|
|
|
650
661
|
- Send character: We only support `1 to 9` and `* #`.
|
|
651
662
|
|
|
652
|
-
```
|
|
663
|
+
```javascript
|
|
653
664
|
import {sendDTMF} from 'omikit-plugin';
|
|
654
665
|
|
|
655
666
|
sendDTMF({
|
|
@@ -658,7 +669,7 @@ We need you request permission about call before make call:
|
|
|
658
669
|
```
|
|
659
670
|
|
|
660
671
|
- Get current user information:
|
|
661
|
-
```
|
|
672
|
+
```javascript
|
|
662
673
|
final user = await getCurrentUser();
|
|
663
674
|
Output Sample:
|
|
664
675
|
{
|
|
@@ -669,7 +680,7 @@ We need you request permission about call before make call:
|
|
|
669
680
|
}
|
|
670
681
|
```
|
|
671
682
|
- Get guest user information:
|
|
672
|
-
```
|
|
683
|
+
```javascript
|
|
673
684
|
final user = await getGuestUser();
|
|
674
685
|
Output Sample:
|
|
675
686
|
{
|
|
@@ -681,7 +692,7 @@ We need you request permission about call before make call:
|
|
|
681
692
|
```
|
|
682
693
|
- Get user information from sip:
|
|
683
694
|
|
|
684
|
-
```
|
|
695
|
+
```javascript
|
|
685
696
|
final user = await getUserInfo("111");
|
|
686
697
|
Output Sample:
|
|
687
698
|
{
|
|
@@ -694,7 +705,7 @@ We need you request permission about call before make call:
|
|
|
694
705
|
|
|
695
706
|
- Logout: logout and remove all information.
|
|
696
707
|
|
|
697
|
-
```
|
|
708
|
+
```javascript
|
|
698
709
|
import {logout} from 'omikit-plugin';
|
|
699
710
|
|
|
700
711
|
logout();
|
|
@@ -702,7 +713,7 @@ We need you request permission about call before make call:
|
|
|
702
713
|
|
|
703
714
|
- Permission: Check system alert window permission (only Android).
|
|
704
715
|
|
|
705
|
-
```
|
|
716
|
+
```javascript
|
|
706
717
|
import {systemAlertWindow} from 'omikit-plugin';
|
|
707
718
|
|
|
708
719
|
if (Platform.OS === 'android') {
|
|
@@ -714,7 +725,7 @@ We need you request permission about call before make call:
|
|
|
714
725
|
|
|
715
726
|
- Setting: Open to enable system alert window (only Android).
|
|
716
727
|
|
|
717
|
-
```
|
|
728
|
+
```javascript
|
|
718
729
|
import {openSystemAlertSetting} from 'omikit-plugin';
|
|
719
730
|
|
|
720
731
|
if (Platform.OS === 'android') {
|
|
@@ -726,56 +737,56 @@ We need you request permission about call before make call:
|
|
|
726
737
|
|
|
727
738
|
- Switch front/back camera: We use the front camera for first time.
|
|
728
739
|
|
|
729
|
-
```
|
|
740
|
+
```javascript
|
|
730
741
|
import {switchOmiCamera} from 'omikit-plugin';
|
|
731
742
|
switchOmiCamera();
|
|
732
743
|
```
|
|
733
744
|
|
|
734
745
|
- Toggle a video in video call: On/off video in video call
|
|
735
746
|
|
|
736
|
-
```
|
|
747
|
+
```javascript
|
|
737
748
|
import {toggleOmiVideo} from 'omikit-plugin';
|
|
738
749
|
toggleOmiVideo();
|
|
739
750
|
```
|
|
740
751
|
|
|
741
752
|
- Local Camera Widget: Your camera view in a call
|
|
742
753
|
|
|
743
|
-
```
|
|
754
|
+
```javascript
|
|
744
755
|
import { OmiLocalCameraView } from 'omikit-plugin';
|
|
745
756
|
<OmiLocalCameraView style={styles.localCamera} />
|
|
746
757
|
```
|
|
747
758
|
|
|
748
759
|
- Remote Camera Widget: Remote camera view in a call
|
|
749
760
|
|
|
750
|
-
```
|
|
761
|
+
```javascript
|
|
751
762
|
import { OmiRemoteCameraView } from 'omikit-plugin';
|
|
752
763
|
<OmiRemoteCameraView style={styles.remoteCamera} />
|
|
753
764
|
```
|
|
754
765
|
|
|
755
766
|
- More function: Refresh local camera
|
|
756
767
|
|
|
757
|
-
```
|
|
768
|
+
```javascript
|
|
758
769
|
import {refreshLocalCamera} from 'omikit-plugin';
|
|
759
770
|
refreshLocalCamera();
|
|
760
771
|
```
|
|
761
772
|
|
|
762
773
|
- More function: Refresh remote camera
|
|
763
774
|
|
|
764
|
-
```
|
|
775
|
+
```javascript
|
|
765
776
|
import {refreshRemoteCamera} from 'omikit-plugin';
|
|
766
777
|
refreshRemoteCamera();
|
|
767
778
|
```
|
|
768
779
|
|
|
769
780
|
- Register event: Register remote video ready: only visible on iOS
|
|
770
781
|
|
|
771
|
-
```
|
|
782
|
+
```javascript
|
|
772
783
|
import {registerVideoEvent} from 'omikit-plugin';
|
|
773
784
|
registerVideoEvent();
|
|
774
785
|
```
|
|
775
786
|
|
|
776
787
|
- Event listener:
|
|
777
788
|
|
|
778
|
-
```
|
|
789
|
+
```javascript
|
|
779
790
|
useEffect(() => {
|
|
780
791
|
omiEmitter.addListener(OmiCallEvent.onCallStateChanged, onCallStateChanged);
|
|
781
792
|
omiEmitter.addListener(OmiCallEvent.onMuted, onMuted);
|
|
@@ -830,15 +841,32 @@ useEffect(() => {
|
|
|
830
841
|
|
|
831
842
|
| Code | Description |
|
|
832
843
|
| --------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
833
|
-
| `600, 503, 480`
|
|
834
|
-
| `408`
|
|
835
|
-
| `403` | Your service plan only allows calls to dialed numbers. Please upgrade your service pack
|
|
836
|
-
| `404` | The current number is not allowed to make calls to the carrier
|
|
837
|
-
| `603` | The call was rejected. Please check your account limit or call barring configuration!
|
|
838
|
-
| `850` | Simultaneous call limit exceeded, please try again later
|
|
839
|
-
| `486` | The listener refuses the call and does not answer
|
|
840
|
-
| `601` | Call ended by the customer
|
|
841
|
-
| `602` | Call ended by the other employee
|
|
844
|
+
| `600, 503, 480` | These are the codes of the network operator or the user who did not answer the call |
|
|
845
|
+
| `408` | Call request timeout (Each call usually has a waiting time of 30 seconds. If the 30 seconds expire, it will time out) |
|
|
846
|
+
| `403` | Your service plan only allows calls to dialed numbers. Please upgrade your service pack|
|
|
847
|
+
| `404` | The current number is not allowed to make calls to the carrier|
|
|
848
|
+
| `603` | The call was rejected. Please check your account limit or call barring configuration! |
|
|
849
|
+
| `850` | Simultaneous call limit exceeded, please try again later |
|
|
850
|
+
| `486` | The listener refuses the call and does not answer |
|
|
851
|
+
| `601` | Call ended by the customer |
|
|
852
|
+
| `602` | Call ended by the other employee |
|
|
853
|
+
| `603` | The call was rejected. Please check your account limit or call barring configuration |
|
|
854
|
+
| `850` | Simultaneous call limit exceeded, please try again later |
|
|
855
|
+
| `851` | Call duration limit exceeded, please try again later |
|
|
856
|
+
| `852` | Service package not assigned, please contact the provider |
|
|
857
|
+
| `853` | Internal number has been disabled |
|
|
858
|
+
| `854` | Subscriber is in the DNC list |
|
|
859
|
+
| `855` | Exceeded the allowed number of calls for the trial package |
|
|
860
|
+
| `856` | Exceeded the allowed minutes for the trial package |
|
|
861
|
+
| `857` | Subscriber has been blocked in the configuration |
|
|
862
|
+
| `858` | Unidentified or unconfigured number |
|
|
863
|
+
| `859` | No available numbers for Viettel direction, please contact the provider |
|
|
864
|
+
| `860` | No available numbers for VinaPhone direction, please contact the provider |
|
|
865
|
+
| `861` | No available numbers for Mobifone direction, please contact the provider |
|
|
866
|
+
| `862` | Temporary block on Viettel direction, please try again |
|
|
867
|
+
| `863` | Temporary block on VinaPhone direction, please try again |
|
|
868
|
+
| `864` | Temporary block on Mobifone direction, please try again |
|
|
869
|
+
| `865` | he advertising number is currently outside the permitted calling hours, please try again later |
|
|
842
870
|
|
|
843
871
|
- Action Name value:
|
|
844
872
|
- `OmiCallEvent.onMuted`: Audio changed.
|
package/android/build.gradle
CHANGED
|
@@ -85,8 +85,8 @@ allprojects {
|
|
|
85
85
|
maven {
|
|
86
86
|
url "https://maven.pkg.github.com/omicall/OMICall-SDK"
|
|
87
87
|
credentials {
|
|
88
|
-
username = "
|
|
89
|
-
password = "
|
|
88
|
+
username = project.findProperty("OMI_USER") ?: ""
|
|
89
|
+
password = project.findProperty("OMI_TOKEN") ?: ""
|
|
90
90
|
}
|
|
91
91
|
authentication {
|
|
92
92
|
basic(BasicAuthentication)
|
|
@@ -103,7 +103,7 @@ dependencies {
|
|
|
103
103
|
// use for OMISDK
|
|
104
104
|
implementation("androidx.work:work-runtime:2.8.1")
|
|
105
105
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
106
|
-
api 'vn.vihat.omicall:omi-sdk:2.
|
|
106
|
+
api 'vn.vihat.omicall:omi-sdk:2.3.12'
|
|
107
107
|
|
|
108
108
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
109
109
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
package/android/settings.gradle
CHANGED
|
@@ -16,8 +16,8 @@ dependencyResolutionManagement {
|
|
|
16
16
|
maven {
|
|
17
17
|
url "https://maven.pkg.github.com/omicall/OMICall-SDK"
|
|
18
18
|
credentials {
|
|
19
|
-
username = "
|
|
20
|
-
password = "
|
|
19
|
+
username = project.findProperty("OMI_USER") ?: ""
|
|
20
|
+
password = project.findProperty("OMI_TOKEN") ?: ""
|
|
21
21
|
}
|
|
22
22
|
authentication {
|
|
23
23
|
basic(BasicAuthentication)
|
|
@@ -182,8 +182,20 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
override fun onRegisterCompleted(statusCode: Int) {
|
|
185
|
-
Log.d("OMISDK", "
|
|
186
|
-
|
|
185
|
+
Log.d("OMISDK", "=> ON REGISTER COMPLETED => status code: $statusCode")
|
|
186
|
+
|
|
187
|
+
if (statusCode != 200) {
|
|
188
|
+
val mapObject = WritableNativeMap().apply {
|
|
189
|
+
putBoolean("isVideo", false)
|
|
190
|
+
putBoolean("incoming", true)
|
|
191
|
+
putString("callerNumber", "")
|
|
192
|
+
putString("_id", "")
|
|
193
|
+
putInt("status", 6)
|
|
194
|
+
putInt("code_end_call", if (statusCode == 403) 853 else statusCode)
|
|
195
|
+
}
|
|
196
|
+
sendEvent(CALL_STATE_CHANGED, mapObject)
|
|
197
|
+
}
|
|
198
|
+
}
|
|
187
199
|
|
|
188
200
|
|
|
189
201
|
override fun onVideoSize(width: Int, height: Int) {
|
|
@@ -303,24 +315,18 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
303
315
|
mainScope.launch {
|
|
304
316
|
var loginResult = false
|
|
305
317
|
val userName = data.getString("userName")
|
|
306
|
-
Log.d("dataOmi", "INIT_CALL_USER_PASSWORD ==>> $data ")
|
|
307
|
-
Log.d("dataOmi", "INIT_CALL_USER_PASSWORD ==>> $userName ")
|
|
308
318
|
val password = data.getString("password")
|
|
309
319
|
val realm = data.getString("realm")
|
|
310
320
|
val host = data.getString("host") ?: "vh.omicrm.com"
|
|
311
321
|
val isVideo = data.getBoolean("isVideo")
|
|
312
|
-
val firebaseToken = data.getString("fcmToken")
|
|
313
|
-
|
|
314
|
-
Log.d(
|
|
315
|
-
"dataOmi",
|
|
316
|
-
"INIT_CALL_USER_PASSWORD $userName -- $password --$realm --$isVideo -- $host"
|
|
317
|
-
)
|
|
322
|
+
val firebaseToken = data.getString("fcmToken")
|
|
323
|
+
val projectId = data.getString("projectId") ?: ""
|
|
318
324
|
|
|
319
325
|
withContext(Dispatchers.Default) {
|
|
320
326
|
try {
|
|
321
327
|
if (userName != null && password != null && realm != null && firebaseToken != null) {
|
|
322
328
|
loginResult =
|
|
323
|
-
OmiClient.register(userName, password, realm, isVideo ?: true, firebaseToken, host)
|
|
329
|
+
OmiClient.register(userName, password, realm, isVideo ?: true, firebaseToken, host, projectId)
|
|
324
330
|
promise.resolve(loginResult)
|
|
325
331
|
}
|
|
326
332
|
} catch (_: Throwable) {
|
|
@@ -341,6 +347,8 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
341
347
|
val isVideo = data.getBoolean("isVideo") ?: false
|
|
342
348
|
val phone = data.getString("phone")
|
|
343
349
|
val firebaseToken = data.getString("fcmToken") as String
|
|
350
|
+
val projectId = data.getString("projectId") ?: ""
|
|
351
|
+
|
|
344
352
|
requestPermission(isVideo)
|
|
345
353
|
withContext(Dispatchers.Default) {
|
|
346
354
|
try {
|
|
@@ -351,7 +359,8 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
351
359
|
uuid = usrUuid,
|
|
352
360
|
phone = phone ?: "",
|
|
353
361
|
isVideo = isVideo,
|
|
354
|
-
firebaseToken
|
|
362
|
+
firebaseToken,
|
|
363
|
+
projectId
|
|
355
364
|
)
|
|
356
365
|
promise.resolve(true)
|
|
357
366
|
}
|
|
@@ -359,7 +368,6 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
359
368
|
promise.resolve(loginResult)
|
|
360
369
|
}
|
|
361
370
|
}
|
|
362
|
-
|
|
363
371
|
}
|
|
364
372
|
}
|
|
365
373
|
|
|
@@ -428,7 +436,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
428
436
|
OmiClient.getInstance(reactApplicationContext!!).startCall(phoneNumber, isVideo)
|
|
429
437
|
Log.d("OMISDK", "=>> startCallResult START CALL => $startCallResult")
|
|
430
438
|
var statusCalltemp = startCallResult.value as Int;
|
|
431
|
-
if (startCallResult.value == 200) {
|
|
439
|
+
if (startCallResult.value == 200 || startCallResult.value == 407) {
|
|
432
440
|
statusCalltemp = 8
|
|
433
441
|
}
|
|
434
442
|
map.putInt("status", statusCalltemp)
|
|
@@ -132,6 +132,9 @@ class CallManager {
|
|
|
132
132
|
//request permission
|
|
133
133
|
var result = false
|
|
134
134
|
if let usrUuid = params["usrUuid"] as? String, let fullName = params["fullName"] as? String, let apiKey = params["apiKey"] as? String, let token = params["fcmToken"] as? String {
|
|
135
|
+
if let projectID = params["projectId"] as? String, !projectID.isEmpty {
|
|
136
|
+
OmiClient.setFcmProjectId(projectID)
|
|
137
|
+
}
|
|
135
138
|
result = OmiClient.initWithUUID(usrUuid, fullName: fullName, apiKey: apiKey)
|
|
136
139
|
OmiClient.setUserPushNotificationToken(token)
|
|
137
140
|
}
|
|
@@ -146,6 +149,9 @@ class CallManager {
|
|
|
146
149
|
func initWithUserPasswordEndpoint(params: [String: Any]) -> Bool {
|
|
147
150
|
var result = false
|
|
148
151
|
if let userName = params["userName"] as? String, let password = params["password"] as? String, let realm = params["realm"] as? String, let token = params["fcmToken"] as? String {
|
|
152
|
+
if let projectID = params["projectId"] as? String, !projectID.isEmpty {
|
|
153
|
+
OmiClient.setFcmProjectId(projectID)
|
|
154
|
+
}
|
|
149
155
|
OmiClient.initWithUsername(userName, password: password, realm: realm, proxy: "")
|
|
150
156
|
OmiClient.setUserPushNotificationToken(token)
|
|
151
157
|
result = true
|
package/omikit-plugin.podspec
CHANGED