使用EXPO SDK响应本机ios应用的Info.plist文件 [英] Info.plist file for react native ios app using expo SDK

查看:175
本文介绍了使用EXPO SDK响应本机ios应用的Info.plist文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找正确格式化Info.plist文件的格式,以使应用程序内购买可以与react-native-in-app-utils一起使用,但是我不确定如何格式化数据以及要格式化哪种数据插入.

I'm looking to properly format the Info.plist file in order to make in app purchase work with react-native-in-app-utils but I'm not sure how to format the data and what kind of data to insert.

该线程提到有必要在Info.plist文件中包含应用程序捆绑包ID.

This thread mentions the necessity to include the app bundle id inside the Info.plist file.

在应用内购买的iOS设备-没有收到产品

推荐答案

如果您正在使用expo,它将不会向您公开整个info.plist.

If you are using expo, it will not expose the entire info.plist to you.

您可以像这样在app.json中将对象添加为ios对象的子代:

You can add an object as a child of ios object in the app.json like so:

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

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

Which will write to the native level but this is limited. Here is a list of all the keys you can access with while using 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>

查看expos官方文档这里

View expos official docs here

如果您需要对项目的更多低级访问权限,请考虑使用react-native init MyProject而不是create-react-native-app MyProject.

If you need more low level access to your project, consider using react-native init MyProject instead of create-react-native-app MyProject.

这将为您提供对所有ios和android捆绑软件的完全访问权限.

This will provide you with full access to all ios and android bundles.

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

Or if you already built your app via create-react-native-app MyProject you can run react-native eject to get the build of react-native-init MyProject.

请谨慎,该命令运行后将不会返回.

Be cautious, there is no returning once this command is ran.

这篇关于使用EXPO SDK响应本机ios应用的Info.plist文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆