ios 错误 Appstore 连接:Info.plist 文件中缺少目的字符串
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52002466/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error Appstore connect : Missing Purpose String in Info.plist File
提问by John doe
I've submitted my app for review to the App Store Connect. Although the app is still under review, I've received an email to inform me that I have to fix an error. Here is the content of the message:
我已将我的应用提交到 App Store Connect 以供审核。尽管该应用程序仍在审核中,但我已收到一封电子邮件,通知我必须修复错误。以下是邮件内容:
Dear Developer,
We identified one or more issues with a recent delivery for your app XXXXX. Your delivery was successful, but you may wish to correct the following issues in your next delivery:
"Missing Purpose String in Info.plist File. Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs.
After you've corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.
Best regards,
The App Store Team
亲爱的开发者,
我们发现了您的应用 XXXXX 最近交付的一个或多个问题。您的交付成功,但您可能希望在下次交付时更正以下问题:
“Info.plist 文件中缺少目的字符串。您的应用程序的代码引用了一个或多个访问敏感用户数据的 API。应用程序的 Info.plist 文件应包含一个 NSLocationAlwaysUsageDescription 键,其中包含一个面向用户的目的字符串,清楚而完整地解释您的应用程序需要的原因数据。从 2019 年春季开始,所有提交到 App Store 的访问用户数据的应用都需要包含一个用途字符串。如果您使用的是外部库或 SDK,它们可能会引用需要用途字符串的 API。而您的应用可能不会使用这些 API,但仍然需要一个用途字符串。您可以联系库或 SDK 的开发人员,并要求他们发布不包含这些 API 的代码版本。
更正问题后,您可以使用 Xcode 或 Application Loader 将新的二进制文件上传到 iTunes Connect。
此致,
应用商店团队
My app is fully built with Expo and I don't know how to access and modify the Info.plist.
我的应用程序完全是用 Expo 构建的,我不知道如何访问和修改 Info.plist。
Any idea?
任何的想法?
采纳答案by gwalshington
回答by AnthoPak
EDIT April 2019: You now have to add these two keys, as spring 2019 has begun. Note that NSLocationAlwaysUsageDescription
is now deprecated (since iOS 11) and has been replaced with NSLocationAlwaysAndWhenInUseUsageDescription
and NSLocationWhenInUseUsageDescription
. If you want to support lower than iOS 11, you'll have to use the three values.
编辑 2019 年 4 月:您现在必须添加这两个键,因为 2019 年春季已经开始。请注意,NSLocationAlwaysUsageDescription
现在已弃用(自 iOS 11 起)并已替换为NSLocationAlwaysAndWhenInUseUsageDescription
和NSLocationWhenInUseUsageDescription
。如果要支持低于 iOS 11,则必须使用这三个值。
To sum up you have to:
总而言之,您必须:
- Add
NSLocationAlwaysAndWhenInUseUsageDescription
ANDNSLocationWhenInUseUsageDescription
for iOS 11 and more - And add
NSLocationAlwaysUsageDescription
if you want to support iOS 10 and less - And finally, you can add
NSLocationUsageDescription
if you wan to support iOS 8 and less.
- 为 iOS 11 及更多添加
NSLocationAlwaysAndWhenInUseUsageDescription
ANDNSLocationWhenInUseUsageDescription
- 并添加
NSLocationAlwaysUsageDescription
是否要支持 iOS 10 及更低版本 - 最后,
NSLocationUsageDescription
如果您想支持 iOS 8 及更低版本,您可以添加。
You can submit your app even if you got this message !
即使您收到此消息,您也可以提交您的应用程序!
I've just faced the same issue yesterday, even if the app isn't using the location functionality. It may be related to some framework included in the project that have this optional feature.
我昨天刚刚遇到了同样的问题,即使该应用程序没有使用定位功能。它可能与项目中包含的某些具有此可选功能的框架有关。
I can confirm that my app has been approvedeven without the NSLocationAlwaysUsageDescription
and NSLocationWhenInUseUsageDescription
key in info.plist
我可以证实,我的应用程序已被批准,即使没有NSLocationAlwaysUsageDescription
和NSLocationWhenInUseUsageDescription
键info.plist
Indeed, as Apple stated in the mail :
事实上,正如苹果在邮件中所说:
Starting spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.
从 2019 年春季开始,所有提交到 App Store 的访问用户数据的应用程序都需要包含一个用途字符串。
So the only thing to do is to add this key (right now is better, so that you won't forget) in you project so that it will be included in your next update.
所以唯一要做的就是在你的项目中添加这个键(现在更好,这样你就不会忘记),这样它就会包含在你的下一次更新中。
Just add two new entries in your info.plist
, with NSLocationAlwaysUsageDescription
and NSLocationWhenInUseUsageDescription
as keys and a short description of why you use them as the value (even if you don't really use them...).
只需在您的info.plist
,NSLocationAlwaysUsageDescription
和NSLocationWhenInUseUsageDescription
作为键添加两个新条目,并简要说明为什么将它们用作值(即使您并不真正使用它们......)。
回答by vroldan
I have some apps in the store and I tried to distribute a version for QA and the same thing happened in two different Apps. I think this is a new criteria to accept the builds uploads to Appstore connect.
我在商店里有一些应用程序,我试图分发一个 QA 版本,同样的事情发生在两个不同的应用程序中。我认为这是接受构建上传到 Appstore connect 的新标准。
The solution is simple, add the following lines in the .plist file.
解决方法很简单,在 .plist 文件中添加以下几行。
<key>NSLocationAlwaysUsageDescription</key>?
<string>custom message</string>?
<key>NSLocationWhenInUseUsageDescription</key>?
<string>custom message</string>
<key>NSLocationAlwaysUsageDescription</key>?
<string>custom message</string>?
<key>NSLocationWhenInUseUsageDescription</key>?
<string>custom message</string>
PS: In my case have not using any feature of location, but I added these lines in order to comply with Appstore connect guidelines. Btw after receive that email, I could test the app even when they said that build it had some issues.
PS:就我而言,没有使用任何位置功能,但我添加了这些行以符合 Appstore 连接指南。顺便说一句,收到那封电子邮件后,即使他们说构建存在一些问题,我也可以测试该应用程序。
I hope this work for you guys.
我希望这对你们有用。
回答by Juan José Ramírez
It's a new requirement from apple, even if you do not use location. If you want to add the permissions in Xcode, look for "Privacy - Location Usage Description" and "Privacy - Location When In Use Usage Description" and type a custom string for each of them.
这是苹果的新要求,即使您不使用位置。如果您想在 Xcode 中添加权限,请查找“隐私 - 位置使用说明”和“隐私 - 使用时的位置使用说明”并为它们中的每一个键入自定义字符串。
回答by Sachin Nautiyal
For more simplifying you can add these lines in your info.plist. These error are coming because Starting spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.
为了更加简化,您可以在 info.plist 中添加这些行。之所以会出现这些错误,是因为从 2019 年春季开始,所有提交到 App Store 的访问用户数据的应用程序都需要包含一个用途字符串。
- Open info.plist as source code.
Add these following lines in your plist
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>$(PRODUCT_NAME) needs Location access for "some reason"!</string> <key>NSLocationWhenInUseUsageDescription</key> <string>$(PRODUCT_NAME) needs Location access for "some reason"!</string> <key>NSLocationAlwaysUsageDescription</key> <string>$(PRODUCT_NAME) needs Location access for "some reason"!</string>
- 打开 info.plist 作为源代码。
在您的 plist 中添加以下几行
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>$(PRODUCT_NAME) needs Location access for "some reason"!</string> <key>NSLocationWhenInUseUsageDescription</key> <string>$(PRODUCT_NAME) needs Location access for "some reason"!</string> <key>NSLocationAlwaysUsageDescription</key> <string>$(PRODUCT_NAME) needs Location access for "some reason"!</string>
回答by Sumit Sharma
NSLocationAlwaysUsageDescription Your location is required for xyz benefits for you NSLocationWhenInUseUsageDescription Your location is required for xyz benefits for you
NSLocationAlwaysUsageDescription 为您提供 xyz 福利需要您的位置 NSLocationWhenInUseUsageDescription 为您提供 xyz 福利需要您的位置
回答by sebleclerc
We did receive the same email and we aren't using the CoreLocation at all. After a quick search, we found that Parse SDK could use CoreLocation. In Apple's email, they clearly say:
我们确实收到了相同的电子邮件,我们根本没有使用 CoreLocation。经过快速搜索,我们发现 Parse SDK 可以使用 CoreLocation。在 Apple 的电子邮件中,他们清楚地表示:
If you're using external libraries or SDKs, they may reference APIs that require a purpose string.
如果您使用外部库或 SDK,它们可能会引用需要用途字符串的 API。
That mean the minute your code or any other Library or SDKs can use CoreLocation, even if you don't use it, you need to provide privacy description for "When In Use" and "Always Use".
这意味着您的代码或任何其他库或 SDK 可以使用 CoreLocation 的那一刻,即使您不使用它,您也需要为“使用时”和“始终使用”提供隐私说明。
It is also something new from Apple and for now it's only a warning but it will be required starting in Spring 2019 for new submissions.
这也是 Apple 的新东西,目前它只是一个警告,但从 2019 年春季开始,新的提交将需要它。
回答by Sachin Nautiyal
This issue is occurring because you haven't included
发生此问题是因为您尚未包含
<NSLocationAlwaysUsageDescription>
for your app. I faced the same issue when I tried to submit my app on the AppStore. After the app was processed, I got the same mail. I just added the description and now its resolved.
为您的应用程序。当我尝试在 AppStore 上提交我的应用程序时,我遇到了同样的问题。应用程序处理完毕后,我收到了同样的邮件。我刚刚添加了描述,现在已经解决了。
Hope this helps.
希望这可以帮助。
回答by ingconti
There are the following cases:
有以下几种情况:
NSLocationAlwaysAndWhenInUseUsageDescription (iOS>11)
NSLocationWhenInUseUsageDescription (iOS>11)
NSLocationAlwaysUsageDescription (iOS<=10)
NSLocationUsageDescription (seems very old, iOS8?)
Apple states at:
苹果在声明中表示:
Add the
NSLocationWhenInUseUsageDescription
key and theNSLocationAlwaysAndWhenInUseUsageDescription
key to your Info.plistfile.
将
NSLocationWhenInUseUsageDescription
密钥和NSLocationAlwaysAndWhenInUseUsageDescription
密钥添加到您的Info.plist文件中。
and:
和:
If your app supports iOS 10 and earlier, add the
NSLocationAlwaysUsage
如果您的应用支持 iOS 10 及更早版本,请添加
NSLocationAlwaysUsage
NSLocationUsageDescription
seems dead, the only ref in ADC site is:
https://developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf
NSLocationUsageDescription
似乎死了,ADC 站点中唯一的参考是:https:
//developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf
So to be sure, use first 3.
所以可以肯定的是,使用前 3。
回答by Abdul Qayum
I also face the same issue but after 27 hours, I received the email about approved even I did nothing. So wait for approximately 24 hours instead of doing all this process again.
我也面临同样的问题,但 27 小时后,即使我什么也没做,我也收到了关于已批准的电子邮件。因此,请等待大约 24 小时,而不是再次执行所有这些过程。