@apirtc/expo-apirtc-options-plugin 0.0.8 → 0.0.10

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.
@@ -11,4 +11,5 @@
11
11
 
12
12
  @interface RCT_EXTERN_MODULE(ReactNativeApiRTC_RPK, RCTEventEmitter)
13
13
  RCT_EXTERN_METHOD(sendBroadcastNeedToBeStopped)
14
+ RCT_EXTERN_METHOD(showVideoEffectsUI)
14
15
  @end
@@ -9,6 +9,7 @@ import Foundation
9
9
  import ReplayKit
10
10
  import Photos
11
11
  import UIKit
12
+ import AVFoundation
12
13
  import React
13
14
 
14
15
  @objc(ReactNativeApiRTC_RPK)
@@ -63,6 +64,15 @@ class ReactNativeApiRTC_RPK: RCTEventEmitter {
63
64
  status = "Empty"
64
65
  }
65
66
 
67
+ @objc
68
+ func showVideoEffectsUI() {
69
+ if #available(iOS 15.4, *) {
70
+ DispatchQueue.main.async {
71
+ AVCaptureDevice.showSystemUserInterface(.videoEffects)
72
+ }
73
+ }
74
+ }
75
+
66
76
  //This function is used to send a notification to the extension to stop the broadcast
67
77
  @objc
68
78
  func sendBroadcastNeedToBeStopped() {
@@ -52,15 +52,18 @@ const REQUIRED_PERMISSIONS = [
52
52
  "android.permission.FOREGROUND_SERVICE_CAMERA"
53
53
  ];
54
54
  const MLKIT_SEGMENTATION_DEP = 'implementation("com.google.mlkit:segmentation-selfie:16.0.0-beta6")';
55
- function getAndroidPackagePath(projectRoot) {
55
+ function getAndroidPackagePath(projectRoot, packageNameHint) {
56
56
  var _a, _b;
57
- const manifestPath = path.join(projectRoot, 'android/app/src/main/AndroidManifest.xml');
58
- let packageName;
59
- if (fs.existsSync(manifestPath)) {
60
- const manifestContent = fs.readFileSync(manifestPath, 'utf8');
61
- const match = manifestContent.match(/package="([\w.]+)"/);
62
- if (match) {
63
- packageName = match[1];
57
+ let packageName = packageNameHint;
58
+ // Fallback: read from AndroidManifest.xml
59
+ if (!packageName) {
60
+ const manifestPath = path.join(projectRoot, 'android/app/src/main/AndroidManifest.xml');
61
+ if (fs.existsSync(manifestPath)) {
62
+ const manifestContent = fs.readFileSync(manifestPath, 'utf8');
63
+ const match = manifestContent.match(/package="([\w.]+)"/);
64
+ if (match) {
65
+ packageName = match[1];
66
+ }
64
67
  }
65
68
  }
66
69
  // Fallback: read from app.config.ts or app.config.js
@@ -91,12 +94,12 @@ function getAndroidPackagePath(projectRoot) {
91
94
  }
92
95
  }
93
96
  if (!packageName) {
94
- throw new Error('Package name not found in AndroidManifest.xml, app.config.ts, app.config.js or app.json');
97
+ throw new Error('Package name not found in config.android.package, AndroidManifest.xml, app.config.ts, app.config.js or app.json');
95
98
  }
96
99
  return path.join(projectRoot, 'android/app/src/main/java', ...packageName.split('.'));
97
100
  }
98
- function getPackageName(projectRoot) {
99
- return getAndroidPackagePath(projectRoot)
101
+ function getPackageName(projectRoot, packageNameHint) {
102
+ return getAndroidPackagePath(projectRoot, packageNameHint)
100
103
  .replace(path.join(projectRoot, 'android/app/src/main/java') + path.sep, '')
101
104
  .split(path.sep)
102
105
  .join('.');
@@ -186,10 +189,11 @@ const withAndroidPlugin = (config, props) => {
186
189
  let updatedConfig = (0, config_plugins_1.withMainApplication)(config, (config) => {
187
190
  const mainApplication = config.modResults;
188
191
  const packageName = (() => {
192
+ var _a, _b;
189
193
  try {
190
- return getPackageName(config.modRequest.projectRoot);
194
+ return getPackageName(config.modRequest.projectRoot, (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.package) !== null && _b !== void 0 ? _b : undefined);
191
195
  }
192
- catch (_a) {
196
+ catch (_c) {
193
197
  return null;
194
198
  }
195
199
  })();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apirtc/expo-apirtc-options-plugin",
3
- "version": "0.0.8",
4
- "description": "Plugin Expo pour ajouter les features apiRTC dans une application React Native",
3
+ "version": "0.0.10",
4
+ "description": "Expo Plugin to add apiRTC features in a React Native application",
5
5
  "main": "index.js",
6
6
  "keywords": [
7
7
  "expo",