我正在寻找正确的格式信息.plist文件,以使应用内购买与react native应用内UTIL一起工作,但我不确定如何格式化数据以及插入什么样的数据.

这个帖子提到了在信息中包含应用包id的必要性.plist文件.

iOS in app purchase - no products received

推荐答案

如果你使用的是expo,它不会向你展示整个info.plist个.

expo 变通方案

您可以在app.json中添加一个对象作为ios对象的子对象,如下所示:

"infoPlist": {
  "NSCameraUsageDescription": "This app uses the camera to scan barcodes on event tickets."
},

将写入本机级别,但这是有限的.以下是使用expo时可以使用的所有 keys 列表

<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>

查看expo 官方文件here

react 本机初始化

如果需要对项目进行较低级别的访问,请考虑使用react-native init MyProject而不是create-react-native-app MyProject.

这将为您提供对所有ios和androidBundle 包的完全访问.

react 本机弹出

或者,如果你已经通过create-react-native-app MyProject构建了你的应用,你可以运行react-native eject来获得react-native-init MyProject的构建.

小心,一旦执行此命令,就不会返回.

React-native相关问答推荐

原生react :顶部的滑块位置

使用FETCH发送BLOB/文件时为空

React Native 动画.您必须在转换属性中精确指定一个属性.

应用管理

如何防止 VS Code 从react-native-web自动导入?

reactnavigation后退按钮的自定义后退导航

从 .apk 到 .aab 的本地构建版本react,如何将应用程序发送给客户端?

在 CircleCI 上 ReactNative 0.59.x build fails on CircleCI with exit value 137

React Native 上传到 S3 存储空间

缺少请求的请求令牌

使用 Bearer身份验证令牌react native图像

请求的体验使用 Expo SDK v(null),但此 Expo Client至少需要 v23.0.0版本

获取没有地理位置 API React-native 的国家/城市?

如果我有 AngularJS 基础知识,怎么学习Thinking in ReactJS呢?

React Native 无法运行堆栈跟踪

React本机IOS,当TextInput获得焦点时,按钮按下不注册

如何在 React Native 中禁用图像淡入效果?

当前未启用语法nullishCoalescingOperator

react-native iOS 应用在部署后不显示静态/本地资源

React Native 项目,有时使用 expo start 获得连接 ECONNREFUSED 127.0.0.1:19001