如果您使用的是expo,则不会暴露整个
info.plist
给你。
世博会解决方案
可以将对象添加为的子对象
ios
中的对象
app.json
像这样:
"infoPlist": {
"NSCameraUsageDescription": "This app uses the camera to scan barcodes on event tickets."
},
将写入本机级别,但这是有限的。以下是使用expo时可以使用的所有钥匙列表
<key>NSCameraUsageDescription</key>
<string>Allow Expo experiences to use your camera</string>
<key>NSContactsUsageDescription</key>
<string>Allow Expo experiences to access your contacts</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow Expo experiences to use your location</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow Expo experiences to access your microphone</string>
<key>NSMotionUsageDescription</key>
<string>Allow Expo experiences to access your device's accelerometer</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Give Expo experiences permission to save photos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Give Expo experiences permission to access your photos</string>
查看世博会官方文档
here
反应本机初始化
如果需要对项目进行更多的低级访问,请考虑使用
react-native init MyProject
而不是
create-react-native-app MyProject
.
这将为您提供对所有ios和android捆绑包的完全访问权限。
反应本机弹出
或者如果您已经通过
创建react native app MyProject
你可以跑步
react-native eject
要获得
react-native-init MyProject
.
小心,一旦运行此命令,就不会返回。