我希望正确格式化 Info.plist 文件,以便使用 react-native-in-app-utils 进行应用内购买,但我不确定如何格式化数据以及要插入的数据类型。
该线程提到在 Info.plist 文件中包含应用程序包 ID 的必要性。
我希望正确格式化 Info.plist 文件,以便使用 react-native-in-app-utils 进行应用内购买,但我不确定如何格式化数据以及要插入的数据类型。
该线程提到在 Info.plist 文件中包含应用程序包 ID 的必要性。
如果您使用 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>
在此处查看博览会官方文档
如果你需要你的项目更多的低级别的访问权限,可以考虑使用react-native init MyProject
替代create-react-native-app MyProject
。
这将为您提供对所有 ios 和 android 包的完全访问权限。
或者,如果您已经通过构建应用程序,则create-react-native-app MyProject
可以运行react-native eject
以获取react-native-init MyProject
.
小心,一旦运行此命令就不会返回。