omikit-plugin 3.3.5 → 3.3.7

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
@@ -125,6 +125,17 @@ You can refer <a href="https://github.com/VIHATTeam/OMICALL-React-Native-SDK/blo
125
125
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
126
126
  <uses-permission android:name="android.permission.WAKE_LOCK" />
127
127
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
128
+
129
+ <!-- 🔥 Android 15+ (SDK 35+) Required Permissions -->
130
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
131
+ <uses-permission android:name="android.permission.RECORD_AUDIO"/>
132
+ <uses-permission android:name="android.permission.CALL_PHONE"/>
133
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
134
+ <uses-permission android:name="android.permission.USE_SIP"/>
135
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
136
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL"/>
137
+ <uses-permission android:name="android.permission.CAMERA"/> <!-- For video calls -->
138
+
128
139
  // ... your config
129
140
 
130
141
  <application
@@ -568,6 +579,62 @@ We support 2 environments. So you need set correct key in Appdelegate.
568
579
 
569
580
  ```
570
581
 
582
+ ### 🔥 **Android 15+ Permission Management**
583
+
584
+ **📌 For Android 15+ (SDK 35+), additional permissions are required:**
585
+
586
+ ```xml
587
+ <!-- Required in AndroidManifest.xml -->
588
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
589
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
590
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL"/>
591
+ ```
592
+
593
+ **📌 Built-in Permission Functions:**
594
+
595
+ ✅ **checkPermissionStatus()** - Check current permission status:
596
+ ```javascript
597
+ import { checkPermissionStatus } from 'omikit-plugin';
598
+
599
+ const permissionStatus = await checkPermissionStatus();
600
+ console.log(permissionStatus);
601
+ // Output: { essentialGranted: [...], essentialMissing: [...], canMakeVoipCalls: true/false }
602
+ ```
603
+
604
+ ✅ **checkAndRequestPermissions()** - Request all necessary permissions:
605
+ ```javascript
606
+ import { checkAndRequestPermissions } from 'omikit-plugin';
607
+
608
+ const isVideo = true; // Set to true if video call permissions needed
609
+ const permissionsGranted = await checkAndRequestPermissions(isVideo);
610
+ if (permissionsGranted) {
611
+ console.log('All permissions granted!');
612
+ }
613
+ ```
614
+
615
+ ✅ **requestPermissionsByCodes()** - Request specific permissions by error codes:
616
+ ```javascript
617
+ import { requestPermissionsByCodes } from 'omikit-plugin';
618
+
619
+ // Request specific permissions based on error codes from OmiSDK
620
+ const codes = [450, 451, 452]; // Permission error codes
621
+ const result = await requestPermissionsByCodes(codes);
622
+
623
+ /*
624
+ Permission Code Mapping:
625
+ - 450: RECORD_AUDIO permission (Android 14+)
626
+ - 451: FOREGROUND_SERVICE permissions (Android 14+)
627
+ - 452: POST_NOTIFICATIONS permission (Android 13+)
628
+ */
629
+ ```
630
+
631
+ **📌 System Alert Window Permission:**
632
+ ```javascript
633
+ import { requestSystemAlertWindowPermission } from 'omikit-plugin';
634
+
635
+ const canDrawOverlays = await requestSystemAlertWindowPermission();
636
+ ```
637
+
571
638
  - ✅ Set up <a href="https://rnfirebase.io/messaging/usage">Cloud Messaging</a> plugin:
572
639
 
573
640
  ```
@@ -695,6 +762,49 @@ if (result){
695
762
  }
696
763
  ```
697
764
 
765
+ 📌 **checkCredentials()** *(OmiSDK 2.3.67+)*
766
+
767
+ ✅ Description: Check credentials without maintaining connection. Useful for validating login information before actual registration.
768
+
769
+ ```javascript
770
+ import { checkCredentials } from 'omikit-plugin';
771
+
772
+ const loginInfo = {
773
+ userName: "your_username",
774
+ password: "your_password",
775
+ realm: "your_realm",
776
+ fcmToken: "your_fcm_token",
777
+ projectId: "your_project_id"
778
+ };
779
+
780
+ const result = await checkCredentials(loginInfo);
781
+ console.log(result);
782
+ // Output: { success: true/false, statusCode: number, message: string }
783
+ ```
784
+
785
+ 📌 **registerWithOptions()** *(OmiSDK 2.3.67+)*
786
+
787
+ ✅ Description: Register with full control over notification and auto-unregister behavior.
788
+
789
+ ```javascript
790
+ import { registerWithOptions } from 'omikit-plugin';
791
+
792
+ const loginInfo = {
793
+ userName: "your_username",
794
+ password: "your_password",
795
+ realm: "your_realm",
796
+ isVideo: true,
797
+ fcmToken: "your_fcm_token",
798
+ projectId: "your_project_id",
799
+ showNotification: false, // Control notification display
800
+ enableAutoUnregister: false // Control auto-unregister behavior
801
+ };
802
+
803
+ const result = await registerWithOptions(loginInfo);
804
+ console.log(result);
805
+ // Output: { success: true/false, statusCode: number, message: string }
806
+ ```
807
+
698
808
  📌 **configPushNotification()**
699
809
 
700
810
  ✅ Description: Config push notification: func is used to configure the incoming call popup UI on Android and the representative name for iOS
@@ -1001,6 +1111,39 @@ const result = await startCallWithUuid({
1001
1111
  logout();
1002
1112
  ```
1003
1113
 
1114
+ 📌 **hideSystemNotificationSafely()** *(OmiSDK 2.3.67+)*
1115
+
1116
+ ✅ Description: Safely hide system notification and unregister after a delay.
1117
+
1118
+ ```javascript
1119
+ import { hideSystemNotificationSafely } from 'omikit-plugin';
1120
+
1121
+ const success = await hideSystemNotificationSafely();
1122
+ // Hides notification and unregisters after 2 seconds
1123
+ ```
1124
+
1125
+ 📌 **hideSystemNotificationOnly()** *(OmiSDK 2.3.67+)*
1126
+
1127
+ ✅ Description: Hide system notification only, without unregistering.
1128
+
1129
+ ```javascript
1130
+ import { hideSystemNotificationOnly } from 'omikit-plugin';
1131
+
1132
+ const success = await hideSystemNotificationOnly();
1133
+ // Keeps registration active but hides notification
1134
+ ```
1135
+
1136
+ 📌 **hideSystemNotificationAndUnregister()** *(OmiSDK 2.3.67+)*
1137
+
1138
+ ✅ Description: Hide notification and unregister with custom reason.
1139
+
1140
+ ```javascript
1141
+ import { hideSystemNotificationAndUnregister } from 'omikit-plugin';
1142
+
1143
+ const success = await hideSystemNotificationAndUnregister("User logout");
1144
+ // Hides notification and unregisters immediately with reason
1145
+ ```
1146
+
1004
1147
  📌 **systemAlertWindow()**
1005
1148
 
1006
1149
  ✅ Description: Check system alert window permission (only Android).
@@ -1285,6 +1428,40 @@ const onSwitchboardAnswer = (data: any) => {
1285
1428
  | `864` | Temporary block on Mobifone direction, please try again |
1286
1429
  | `865` | he advertising number is currently outside the permitted calling hours, please try again later |
1287
1430
 
1431
+ # 🔥 Android 15+ Compatibility Features
1432
+
1433
+ ## ✨ New in Version 3.3.5+
1434
+
1435
+ ### **Enhanced Permission Management**
1436
+ - **Full Android 15 (SDK 35+) Support**: Automatic handling of new foreground service permissions
1437
+ - **Smart Permission Requests**: Built-in functions to request specific permissions by error codes
1438
+ - **Comprehensive Status Checking**: Real-time permission status monitoring
1439
+ - **Version-Aware Logic**: Automatically handles Android version differences
1440
+
1441
+ ### **Advanced Registration Options** *(OmiSDK 2.3.67+)*
1442
+ - **Silent Registration**: Register without notifications or auto-unregister
1443
+ - **Credential Validation**: Check login credentials without connecting
1444
+ - **Custom Registration**: Full control over notification and unregister behavior
1445
+ - **Notification Management**: Fine-grained control over system notifications
1446
+
1447
+ ### **Error Code Mapping**
1448
+ Complete mapping of OmiSDK status codes to user-friendly error messages:
1449
+ - **450**: RECORD_AUDIO permission required for Android 14+
1450
+ - **451**: FOREGROUND_SERVICE permission required
1451
+ - **452**: POST_NOTIFICATIONS permission required for Android 13+
1452
+ - **500-600**: Service and network error handling
1453
+ - **Detailed Messages**: Customer-friendly error descriptions for easier integration
1454
+
1455
+ ### **Development Workflow**
1456
+ - **copy_dev.sh**: Efficient development workflow for testing native code changes
1457
+ - **Automatic Build Fixes**: Handles gradle namespace issues automatically
1458
+ - **Hot Reload**: Quick testing without npm publishing
1459
+
1460
+ ### **Breaking Changes**
1461
+ - **Android 15+ Support**: Requires additional permissions in AndroidManifest.xml
1462
+ - **New Architecture**: Still requires `newArchEnabled=false`
1463
+ - **Minimum SDK**: Android SDK 21+ recommended for full feature support
1464
+
1288
1465
  # ⚠️ Issues
1289
1466
 
1290
1467
 
@@ -62,6 +62,7 @@ def getExtOrIntegerDefault(name) {
62
62
  }
63
63
 
64
64
  android {
65
+ namespace "com.omikitplugin"
65
66
  compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
66
67
 
67
68
  defaultConfig {
@@ -121,7 +122,7 @@ dependencies {
121
122
  implementation("androidx.work:work-runtime:2.8.1")
122
123
  implementation "androidx.security:security-crypto:1.1.0-alpha06"
123
124
  // api 'vn.vihat.omicall:omi-sdk:2.3.23'
124
- api "io.omicrm.vihat:omi-sdk:2.3.87"
125
+ api "io.omicrm.vihat:omi-sdk:2.3.88"
125
126
 
126
127
  implementation "com.facebook.react:react-native:+" // From node_modules
127
128
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"