omikit-plugin 3.2.53 → 3.2.55

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 CHANGED
@@ -700,7 +700,7 @@ We need you request permission about call before make call:
700
700
  await joinCall();
701
701
  ```
702
702
 
703
- Note: When calling `joinCall`, sdk will check permission of microphone and camera. If have any permission denied, sdk will send a event `onRequestPermission` with list permission you need to request. You need to request permission before calling `joinCall` again.
703
+ Note: When calling `joinCall`, sdk will check permission of microphone and camera. If have any permission denied, sdk will send a event `onRequestPermissionAndroid` with list permission you need to request. You need to request permission before calling `joinCall` again.
704
704
 
705
705
  - End a call: We will push a event `endCall` for you.
706
706
 
@@ -882,7 +882,7 @@ useEffect(() => {
882
882
  omiEmitter.addListener(OmiCallEvent.onClickMissedCall, clickMissedCall);
883
883
  omiEmitter.addListener(OmiCallEvent.onSwitchboardAnswer, onSwitchboardAnswer);
884
884
  omiEmitter.addListener(OmiCallEvent.onCallQuality, onCallQuality);
885
- omiEmitter.addListener(OmiCallEvent.onRequestPermission, onRequestPermission);
885
+ omiEmitter.addListener(OmiCallEvent.onRequestPermissionAndroid, onRequestPermission);
886
886
  if (Platform.OS === 'ios') {
887
887
  registerVideoEvent();
888
888
  omiEmitter.addListener(
@@ -896,7 +896,7 @@ useEffect(() => {
896
896
  omiEmitter.removeAllListeners(OmiCallEvent.onHold);
897
897
  omiEmitter.removeAllListeners(OmiCallEvent.onSpeaker);
898
898
  omiEmitter.removeAllListeners(OmiCallEvent.onSwitchboardAnswer);
899
- omiEmitter.removeAllListeners(OmiCallEvent.onRequestPermission);
899
+ omiEmitter.removeAllListeners(OmiCallEvent.onRequestPermissionAndroid);
900
900
  if (Platform.OS === 'ios') {
901
901
  removeVideoEvent();
902
902
  omiEmitter.removeAllListeners(OmiCallEvent.onRemoteVideoReady);
@@ -1,27 +1,43 @@
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
- }
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
+ // }
16
26
 
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
- }
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
+ }
25
41
  }
26
42
 
27
43
  def isNewArchitectureEnabled() {
@@ -53,6 +69,11 @@ android {
53
69
  targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
54
70
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
55
71
  }
72
+ buildFeatures {
73
+ buildConfig = true
74
+ }
75
+
76
+
56
77
  buildTypes {
57
78
  release {
58
79
  minifyEnabled false
@@ -68,33 +89,29 @@ android {
68
89
  targetCompatibility JavaVersion.VERSION_1_8
69
90
  }
70
91
 
71
- // kotlinOptions {
72
- // jvmTarget = '1.8'
73
- // }
92
+
93
+ kotlinOptions {
94
+ jvmTarget = "1.8"
95
+ }
96
+
74
97
 
75
98
  dataBinding {
76
99
  enabled = true
77
100
  }
78
101
  }
79
102
 
80
- allprojects {
81
- repositories {
82
- google()
83
- mavenCentral()
84
- jcenter() // Warning: this repository is going to shut down soon
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
- }
94
- }
95
- }
103
+
104
+ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
105
+ kotlinOptions {
106
+ jvmTarget = "1.8"
107
+ }
96
108
  }
97
109
 
110
+ dependencies {
111
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
112
+ }
113
+
114
+
98
115
 
99
116
  def kotlin_version = getExtOrDefault("kotlinVersion")
100
117
 
@@ -1,4 +1,4 @@
1
- OmikitPlugin_kotlinVersion=1.7.10
1
+ OmikitPlugin_kotlinVersion=1.8
2
2
  OmikitPlugin_minSdkVersion=24
3
3
  OmikitPlugin_targetSdkVersion=33
4
4
  OmikitPlugin_compileSdkVersion=33
@@ -3,21 +3,31 @@ pluginManagement {
3
3
  google()
4
4
  mavenCentral()
5
5
  gradlePluginPortal()
6
+ maven { url "https://jitpack.io" }
7
+ maven {
8
+ url "https://maven.pkg.github.com/omicall/OMICall-SDK"
9
+ credentials {
10
+ username = System.getenv("OMI_USER") ?: ""
11
+ password = System.getenv("OMI_TOKEN") ?: ""
12
+ }
13
+ authentication {
14
+ basic(BasicAuthentication)
15
+ }
16
+ }
6
17
  }
7
18
  }
19
+
8
20
  dependencyResolutionManagement {
9
- repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
21
+ repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // Cho phép settings.gradle ưu tiên repositories
10
22
  repositories {
11
23
  google()
12
24
  mavenCentral()
13
- maven {
14
- url "https://jitpack.io"
15
- }
25
+ maven { url "https://jitpack.io" }
16
26
  maven {
17
27
  url "https://maven.pkg.github.com/omicall/OMICall-SDK"
18
28
  credentials {
19
- username = project.findProperty("OMI_USER") ?: ""
20
- password = project.findProperty("OMI_TOKEN") ?: ""
29
+ username = System.getenv("OMI_USER") ?: ""
30
+ password = System.getenv("OMI_TOKEN") ?: ""
21
31
  }
22
32
  authentication {
23
33
  basic(BasicAuthentication)
@@ -162,7 +162,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
162
162
  }
163
163
 
164
164
  override fun onMuted(isMuted: Boolean) {
165
- sendEvent(MUTED, isMuted)
165
+ sendEvent(MUTED, isMuted)
166
166
  }
167
167
 
168
168
  override fun onOutgoingStarted(callerId: Int, phoneNumber: String?, isVideo: Boolean?) {
@@ -515,15 +515,17 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
515
515
 
516
516
  @ReactMethod
517
517
  fun endCall(promise: Promise) {
518
- if (isIncomming && !isAnserCall) {
519
- OmiClient.getInstance(reactApplicationContext!!).decline()
520
- } else {
521
- OmiClient.getInstance(reactApplicationContext!!).hangUp()
522
- }
518
+ OmiClient.getInstance(reactApplicationContext!!).hangUp()
523
519
  promise.resolve(true)
524
520
 
525
521
  }
526
522
 
523
+ @ReactMethod
524
+ fun rejectCall(promise: Promise) {
525
+ OmiClient.getInstance(reactApplicationContext!!).decline()
526
+ promise.resolve(true)
527
+ }
528
+
527
529
  @ReactMethod
528
530
  fun toggleMute(promise: Promise) {
529
531
  mainScope.launch {
@@ -543,26 +545,26 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
543
545
 
544
546
  @ReactMethod
545
547
  fun toggleHold(promise: Promise) {
546
- mainScope.launch {
547
- try {
548
- // Gọi hàm toggleHold() và kiểm tra kết quả
549
- val result = withContext(Dispatchers.IO) {
550
- OmiClient.getInstance(reactApplicationContext!!).toggleHold()
551
- }
548
+ mainScope.launch {
549
+ try {
550
+ // Gọi hàm toggleHold() và kiểm tra kết quả
551
+ val result = withContext(Dispatchers.IO) {
552
+ OmiClient.getInstance(reactApplicationContext!!).toggleHold()
553
+ }
552
554
 
553
- // Kiểm tra nếu toggleHold trả về Unit
554
- if (result == Unit) {
555
- promise.resolve(null) // Trả về null nếu kết quả là Unit
556
- } else {
557
- promise.resolve(result)
558
- }
559
- } catch (e: Exception) {
560
- promise.reject("TOGGLE_HOLD_EXCEPTION", "Exception occurred: ${e.message}", e)
561
- }
555
+ // Kiểm tra nếu toggleHold trả về Unit
556
+ if (result == Unit) {
557
+ promise.resolve(null) // Trả về null nếu kết quả là Unit
558
+ } else {
559
+ promise.resolve(result)
560
+ }
561
+ } catch (e: Exception) {
562
+ promise.reject("TOGGLE_HOLD_EXCEPTION", "Exception occurred: ${e.message}", e)
562
563
  }
563
564
  }
564
565
  }
565
566
 
567
+
566
568
  @ReactMethod
567
569
  fun toggleSpeaker(promise: Promise) {
568
570
  currentActivity?.runOnUiThread {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omikit-plugin",
3
- "version": "3.2.53",
3
+ "version": "3.2.55",
4
4
  "description": "Omikit Plugin by ViHAT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -56,14 +56,14 @@
56
56
  "devDependencies": {
57
57
  "@release-it/conventional-changelog": "^5.0.0",
58
58
  "@types/jest": "^28.1.2",
59
- "@types/react": "~17.0.21",
60
- "@types/react-native": "0.70.0",
59
+ "@types/react": "18.3.1",
60
+ "@types/react-native": "0.76.2",
61
+ "react": "18.3.1",
62
+ "react-native": "0.76.2",
61
63
  "del-cli": "^5.0.0",
62
64
  "jest": "^28.1.1",
63
65
  "pod-install": "^0.1.0",
64
66
  "prettier": "^2.8.4",
65
- "react": "^18.0.0",
66
- "react-native": "^0.71.3",
67
67
  "react-native-builder-bob": "0.20.0",
68
68
  "release-it": "^15.0.0",
69
69
  "typescript": "^4.5.2"