omikit-plugin 3.2.57 → 3.2.60
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/android/build.gradle +4 -7
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/omikitplugin/OmikitPluginModule.kt +22 -16
- package/ios/Library/OmikitNotification.m +2 -7
- package/ios/Library/OmikitPlugin.swift +1 -0
- package/ios/OmikitPlugin.xcodeproj/project.xcworkspace/xcuserdata/qmacstore.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/omikit-plugin.podspec +8 -6
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -85,16 +85,13 @@ android {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
compileOptions {
|
|
88
|
-
sourceCompatibility JavaVersion.
|
|
89
|
-
targetCompatibility JavaVersion.
|
|
88
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
89
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
kotlinOptions {
|
|
94
|
-
jvmTarget = "
|
|
95
|
-
languageVersion = "1.6" // Minimum supported language version for compatibility
|
|
96
|
-
apiVersion = "1.6"
|
|
97
|
-
freeCompilerArgs += ["-Xskip-prerelease-check"]
|
|
94
|
+
jvmTarget = "17"
|
|
98
95
|
}
|
|
99
96
|
|
|
100
97
|
|
|
@@ -106,7 +103,7 @@ android {
|
|
|
106
103
|
|
|
107
104
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
108
105
|
kotlinOptions {
|
|
109
|
-
jvmTarget = "
|
|
106
|
+
jvmTarget = "17"
|
|
110
107
|
}
|
|
111
108
|
}
|
|
112
109
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
OmikitPlugin_kotlinVersion=1.
|
|
1
|
+
OmikitPlugin_kotlinVersion=1.8.20
|
|
2
2
|
OmikitPlugin_minSdkVersion=24
|
|
3
3
|
OmikitPlugin_targetSdkVersion=33
|
|
4
4
|
OmikitPlugin_compileSdkVersion=33
|
|
5
5
|
OmikitPlugin_ndkversion=21.4.7075529
|
|
6
6
|
OMI_USER=omicall
|
|
7
|
-
OMI_TOKEN=
|
|
7
|
+
OMI_TOKEN=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
|
|
@@ -162,7 +162,7 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
override fun onMuted(isMuted: Boolean) {
|
|
165
|
-
|
|
165
|
+
sendEvent(MUTED, isMuted)
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
override fun onOutgoingStarted(callerId: Int, phoneNumber: String?, isVideo: Boolean?) {
|
|
@@ -524,6 +524,12 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
524
524
|
|
|
525
525
|
}
|
|
526
526
|
|
|
527
|
+
@ReactMethod
|
|
528
|
+
fun rejectCall(promise: Promise) {
|
|
529
|
+
OmiClient.getInstance(reactApplicationContext!!).decline()
|
|
530
|
+
promise.resolve(true)
|
|
531
|
+
}
|
|
532
|
+
|
|
527
533
|
@ReactMethod
|
|
528
534
|
fun toggleMute(promise: Promise) {
|
|
529
535
|
mainScope.launch {
|
|
@@ -543,26 +549,26 @@ class OmikitPluginModule(reactContext: ReactApplicationContext?) :
|
|
|
543
549
|
|
|
544
550
|
@ReactMethod
|
|
545
551
|
fun toggleHold(promise: Promise) {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
+
mainScope.launch {
|
|
553
|
+
try {
|
|
554
|
+
// Gọi hàm toggleHold() và kiểm tra kết quả
|
|
555
|
+
val result = withContext(Dispatchers.IO) {
|
|
556
|
+
OmiClient.getInstance(reactApplicationContext!!).toggleHold()
|
|
557
|
+
}
|
|
552
558
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
559
|
+
// Kiểm tra nếu toggleHold trả về Unit
|
|
560
|
+
if (result == Unit) {
|
|
561
|
+
promise.resolve(null) // Trả về null nếu kết quả là Unit
|
|
562
|
+
} else {
|
|
563
|
+
promise.resolve(result)
|
|
564
|
+
}
|
|
565
|
+
} catch (e: Exception) {
|
|
566
|
+
promise.reject("TOGGLE_HOLD_EXCEPTION", "Exception occurred: ${e.message}", e)
|
|
562
567
|
}
|
|
563
568
|
}
|
|
564
569
|
}
|
|
565
570
|
|
|
571
|
+
|
|
566
572
|
@ReactMethod
|
|
567
573
|
fun toggleSpeaker(promise: Promise) {
|
|
568
574
|
currentActivity?.runOnUiThread {
|
|
@@ -6,15 +6,10 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <OmikitPlugin/OmikitPlugin-Swift.h>
|
|
9
10
|
|
|
10
|
-
#if __has_include("omikit_plugin-Swift.h")
|
|
11
|
-
#import "omikit_plugin-Swift.h"
|
|
12
|
-
#else
|
|
13
|
-
#import <omikit_plugin/omikit_plugin-Swift.h>
|
|
14
|
-
#endif
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
@implementation OmikitNotification : NSObject
|
|
12
|
+
@implementation OmikitNotification : NSObject
|
|
18
13
|
+ (void)didRecieve:(NSDictionary*) userInfo{
|
|
19
14
|
[[OmikitPlugin instance] didReceiveWithData:userInfo];
|
|
20
15
|
}
|
|
Binary file
|
package/omikit-plugin.podspec
CHANGED
|
@@ -15,8 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
|
|
16
16
|
# Chỉ định source files
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
|
-
|
|
19
|
-
s.private_header_files = "ios/**/*+Private.h"
|
|
18
|
+
|
|
20
19
|
|
|
21
20
|
# Đảm bảo hỗ trợ Swift
|
|
22
21
|
s.swift_versions = ["5.0"]
|
|
@@ -24,8 +23,7 @@ Pod::Spec.new do |s|
|
|
|
24
23
|
# Định nghĩa module để tránh lỗi Swift bridging header
|
|
25
24
|
s.static_framework = true
|
|
26
25
|
s.pod_target_xcconfig = {
|
|
27
|
-
"DEFINES_MODULE" => "YES"
|
|
28
|
-
"SWIFT_VERSION" => "5.0"
|
|
26
|
+
"DEFINES_MODULE" => "YES"
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
# Xác định module name
|
|
@@ -36,17 +34,21 @@ Pod::Spec.new do |s|
|
|
|
36
34
|
s.dependency "OmiKit", "1.8.1"
|
|
37
35
|
|
|
38
36
|
# Đảm bảo Swift bridging header được tự động tạo
|
|
39
|
-
s.requires_arc = true
|
|
37
|
+
# s.requires_arc = true
|
|
40
38
|
|
|
41
39
|
# Xử lý riêng cho kiến trúc mới (New Architecture)
|
|
42
40
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
43
|
-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
44
41
|
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
45
42
|
s.xcconfig = {
|
|
46
43
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
47
44
|
"OTHER_CPLUSPLUSFLAGS" => folly_compiler_flags,
|
|
48
45
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
49
46
|
}
|
|
47
|
+
s.pod_target_xcconfig = {
|
|
48
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
49
|
+
"OTHER_CPLUSPLUSFLAGS" => folly_compiler_flags,
|
|
50
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
51
|
+
}
|
|
50
52
|
s.dependency "React-Codegen"
|
|
51
53
|
s.dependency "RCT-Folly"
|
|
52
54
|
s.dependency "RCTRequired"
|