omikit-plugin 3.2.57 → 3.2.59

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.
@@ -85,16 +85,13 @@ android {
85
85
  }
86
86
 
87
87
  compileOptions {
88
- sourceCompatibility JavaVersion.VERSION_1_8
89
- targetCompatibility JavaVersion.VERSION_1_8
88
+ sourceCompatibility JavaVersion.VERSION_17
89
+ targetCompatibility JavaVersion.VERSION_17
90
90
  }
91
91
 
92
92
 
93
93
  kotlinOptions {
94
- jvmTarget = "1.8"
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 = "1.8"
106
+ jvmTarget = "17"
110
107
  }
111
108
  }
112
109
 
@@ -1,7 +1,7 @@
1
- OmikitPlugin_kotlinVersion=1.7.10
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=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
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
- sendEvent(MUTED, isMuted)
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
- 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
- }
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
- // 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
- }
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-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
  }
@@ -285,6 +285,7 @@ public class OmikitPlugin: RCTEventEmitter {
285
285
  }
286
286
 
287
287
 
288
+
288
289
  public override func supportedEvents() -> [String]! {
289
290
  return [
290
291
  CALL_STATE_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
- s.public_header_files = "ios/**/*.h"
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"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omikit-plugin",
3
- "version": "3.2.57",
3
+ "version": "3.2.59",
4
4
  "description": "Omikit Plugin by ViHAT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",