我正在安装 react-native-qrcode-scanner 但没有工作。我确实设置了 podfile 和 info.plist,请 heeelp :)
package.json
"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.12",
"@react-native-firebase/app": "^17.4.0",
"@react-native-firebase/auth": "^17.4.0",
"@react-native-firebase/messaging": "^17.4.1",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"axios": "^1.3.4",
"deprecated-react-native-prop-types": "^4.0.0",
"firebase": "^9.18.0",
"lottie-react-native": "^5.1.5",
"pod-install": "^0.1.38",
"react": "18.2.0",
"react-native": "^0.71.6",
"react-native-camera": "^4.2.1",
"react-native-controlled-mentions": "^2.2.5",
"react-native-gesture-bottom-sheet": "^1.1.0",
"react-native-gesture-handler": "^2.9.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-permissions": "^3.8.0",
"react-native-qrcode-scanner": "^1.5.5",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.20.0",
"react-native-select-dropdown": "^3.3.2",
"react-native-svg": "^13.9.0",
"react-native-vector-icons": "^9.2.0",
"react-redux": "^8.0.5",
"redux": "^4.2.1"
},
"reactNativePermissionsIOS": [
"AppTrackingTransparency",
"BluetoothPeripheral",
"Calendars",
"Camera",
"Contacts",
"FaceID",
"LocationAccuracy",
"LocationAlways",
"LocationWhenInUse",
"MediaLibrary",
"Microphone",
"Motion",
"Notifications",
"PhotoLibrary",
"PhotoLibraryAddOnly",
"Reminders",
"Siri",
"SpeechRecognition",
"StoreKit"
],
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.21.0",
"@react-native-community/eslint-config": "^3.2.0",
"@svgr/cli": "^6.5.1",
"@svgr/core": "^6.5.1",
"@tsconfig/react-native": "^2.0.2",
"@types/jest": "^29.2.1",
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.73.8",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},
"jest": {
"preset": "react-native"
}
}
权限的podfile
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
info.plist 权限
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<!-- Include this only if you are planning to use the camera roll -->
<key>NSPhotoLibraryUsageDescription</key>
<string>Your message to user when the photo library is accessed for the first time</string>
<!-- Include this only if you are planning to use the microphone for video recording -->
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microsphone is accessed for the first time</string>
我在安卓端没有问题。我已经尝试解决这个问题一个星期了,但没有成功请帮我解决这个问题,非常感谢。
我试试; 产品 > 清除构建文件夹 删除派生数据 重新安装 node_modules 和 pod 问聊天 gpt :)
如何在我的 iOS 设备上打开相机和阅读二维码