@retion-miniapp/react-native 0.11.0 → 0.11.1

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.
Files changed (2) hide show
  1. package/app.plugin.js +5 -1
  2. package/package.json +1 -1
package/app.plugin.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // Expo prebuild plugin. Bare React Native hosts set NSFaceIDUsageDescription in Info.plist.
2
2
  const { withInfoPlist, withAndroidManifest } = require('expo/config-plugins');
3
3
  const withSpeechRecognition = require('expo-speech-recognition/app.plugin.js');
4
- const withVisionCamera = require('react-native-vision-camera/app.plugin.js');
4
+ // Plugin này build từ ES module nên hàm nằm ở .default.
5
+ const withVisionCamera = require('react-native-vision-camera/app.plugin.js').default;
5
6
 
6
7
  module.exports = function withMiniApp(config, options = {}) {
7
8
  config = withInfoPlist(config, config => {
@@ -25,7 +26,10 @@ module.exports = function withMiniApp(config, options = {}) {
25
26
  androidSpeechServicePackages: options.androidSpeechServicePackages,
26
27
  });
27
28
  // Thêm quyền CAMERA Android và nhúng sẵn model quét mã (ML Kit, khoảng 2,4 MB) để quét được ngay, không cần tải.
29
+ const camera_text = config.ios?.infoPlist?.NSCameraUsageDescription;
28
30
  config = withVisionCamera(config, { enableCodeScanner: true });
31
+ // Plugin vision-camera tự đặt câu mặc định, có thể đè câu của app; câu quyền đã xử lý ở withInfoPlist phía trên.
32
+ if (camera_text === undefined) { delete config.ios.infoPlist.NSCameraUsageDescription; }
29
33
  return withAndroidManifest(config, config => {
30
34
  const manifest = config.modResults.manifest;
31
35
  const permissions = manifest['uses-permission'] || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retion-miniapp/react-native",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "React Native host for Retion Mini Apps with built-in biometric authentication",
5
5
  "license": "MIT",
6
6
  "repository": {