错误Appstore连接:Info.plist文件中缺少目的字符串

问题描述 投票:107回答:14

我已将我的应用程序提交给Appstore 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

我的应用程序完全使用expo构建,我不知道如何访问和修改Info.plist。

任何的想法 ?

ios app-store expo appstore-approval info.plist
14个回答
26
投票

如果您正在使用Expo,可以通过向app.json添加infoPlist来添加求解,如下所示:

  "expo": {
     "ios": {
       "bundleIdentifier": "com.app.myapp",
       "infoPlist": {
         "NSLocationAlwaysUsageDescription": "Some message to appease Apple.",
       },
     },
   }

Expo Docs


2
投票

这些答案都告诉您如何遵守App Store规则以避免出现警告,但真正的解决方案是世博会允许您禁用他们对位置服务的SDK要求,除非您实际使用它们 - 我不确定这是否是可能。


2
投票

同样的问题在2月19日,收到一封电子邮件,其中包含一些我没有使用的权限,我认为它们来自插件。 Apple在3月19日表示这是一项要求,所以我在info.plst中添加这些内容并再次上传。

这确实非常愚蠢。


1
投票

我也面临同样的问题,但在27小时后,我收到了关于批准的电子邮件,即使我什么也没做。所以等待大约24小时,而不是再次完成所有这些过程。


0
投票

我的应用程序也得到了,我没有做任何事情,但它可以运行良好,下次我认为应该在plist中添加这样的键,只是做一些描述


0
投票

我有<key>NSLocationWhenInUseUsageDescription </key>而不是<key>NSLocationWhenInUseUsageDescription</key>

一定要删除尾随空格


0
投票

请查看您从** App Store Connect收到的电子邮件**

识别丢失的密钥enter image description here

说明

  1. 打开info.plist文件。
  2. 从提供的选项中添加和搜索缺少的密钥(例如,联系人=隐私 - 联系人使用说明)
  3. 添加用法说明:

$(PRODUCT_NAME)需要联系人访问“提供原因”。

示例:


38
投票

我在商店里有一些应用程序,我试图为QA分发一个版本,同样的事情发生在两个不同的应用程序中。我认为这是接受构建上传到Appstore connect的新标准。

解决方案很简单,在.plist文件中添加以下行。

<key>NSLocationAlwaysUsageDescription</key>

<string>custom message</string>

<key>NSLocationWhenInUseUsageDescription</key>

<string>custom message</string>

PS:在我的情况下没有使用任何位置功能,但我添加了这些行以符合Appstore连接指南。顺便收到那封电子邮件后,即使他们说构建它有一些问题,我也可以测试它。

我希望这对你们有用。


34
投票

编辑2019年4月:你现在必须添加这两个键,因为2019年春天已经开始。请注意,NSLocationAlwaysUsageDescription现已弃用,已被NSLocationUsageDescription取代。

You can submit your app even if you got this message !

即使应用程序没有使用位置功能,我昨天也遇到了同样的问题。它可能与项目中包含的具有此可选功能的某个框架有关。

即使没有NSLocationAlwaysUsageDescription中的NSLocationWhenInUseUsageDescriptioninfo.plist密钥,我也可以确认我的应用程序已被批准

事实上,正如Apple在邮件中所述:

从2019年春季开始,提交给访问用户数据的App Store的所有应用都需要包含目的字符串。

因此,唯一要做的就是在项目中添加此键(现在更好,以便您不会忘记),以便它将包含在您的下一次更新中。

只需在info.plist中添加两个新条目,使用NSLocationAlwaysUsageDescriptionNSLocationWhenInUseUsageDescription作为键,并简要说明为什么使用它们作为值(即使您没有真正使用它们......)。


11
投票

这是苹果的新要求,即使你不使用位置。如果要在Xcode中添加权限,请查找“隐私 - 位置使用说明”和“隐私 - 使用时的位置使用说明”,并为每个用户键入自定义字符串。

enter image description here


7
投票
##Use this key in info.plist file

NSLocationAlwaysUsageDescription您的位置是xyz福利所必需的NSLocationWhenInUseUsageDescription您的位置是xyz福利所必需的


6
投票

为了更简化,您可以在info.plist中添加这些行。这些错误即将到来,因为从2019年春季开始,提交给App Store访问用户数据的所有应用都需要包含目的字符串。

  1. 打开info.plist作为源代码。
  2. 在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>

6
投票

我们收到了同样的电子邮件,我们根本没有使用CoreLocation。快速搜索后,我们发现Parse SDK可以使用CoreLocation。在Apple的电子邮件中,他们清楚地说:

如果您使用的是外部库或SDK,则它们可能会引用需要用途字符串的API。

这意味着您的代码或任何其他库或SDK可以使用CoreLocation的那一刻,即使您不使用它,您也需要提供“何时使用”和“始终使用”的隐私说明。

它也是Apple的新产品,现在它只是一个警告,但是需要从2019年春季开始提交新的提交。


5
投票

所以现在我们有4个案例..

NSLocationAlwaysAndWhenInUseUsageDescription (iOS>11)
NSLocationWhenInUseUsageDescription          (iOS>11)
NSLocationAlwaysUsageDescription             (iOS<=10)
NSLocationUsageDescription                   (seems very old, iOS8?)

Apple声明:

"Add the NSLocationWhenInUseUsageDescription key and the NSLocationAlwaysAndWhenInUseUsageDescription key to your Info.plist file."

和:

"If your app supports iOS 10 and earlier, add the NSLocationAlwaysUsage"

NSLocationUsageDescription似乎已经死了,ADC网站中唯一的参考是:“https://developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf

所以可以肯定的是,先使用3。


4
投票

发生此问题是因为您尚未包含此问题

 <NSLocationAlwaysUsageDescription>

为您的应用程序。当我尝试在AppStore上提交我的应用程序时,我遇到了同样的问题。应用程序处理完毕后,我收到了同样的邮件。我刚刚添加了描述,现在已经解决了。

希望这可以帮助。

© www.soinside.com 2019 - 2024. All rights reserved.