首页 文章

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

提问于
浏览
66

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

任何的想法 ?

11 回答

  • 2

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

    enter image description here

  • 3

    为了更简化,您可以在info.plist中添加这些行 . 这些错误即将发生,因为 Starting spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose 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>
    
  • 22

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

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

    <key>NSLocationAlwaysUsageDescription</key>
 <string>custom message</string>
 <key>NSLocationWhenInUseUsageDescription</key>
 <string>custom message</string>

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

    我希望这对你们有用 .

  • 6

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

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

    Expo Docs

  • 4

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

  • 1

    ##在info.plist文件中使用此密钥
    NSLocationAlwaysUsageDescription您的位置是xyz福利所必需的NSLocationWhenInUseUsageDescription您的位置是xyz福利所必需的

  • 9

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

    If you're using external libraries or SDKs, they may reference APIs that require a purpose string.

    这意味着您的代码或任何其他库或SDK可以使用CoreLocation的那一刻,即使您不使用它,您也需要提供 When In UseAlway Use 的隐私说明 .

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

  • 15

    所以现在我们有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 .

  • 0

    即使收到此消息,您也可以提交您的应用程序!

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

    I can confirm that my app has been approved 即使 info.plist 中没有 NSLocationAlwaysUsageDescriptionNSLocationWhenInUseUsageDescription

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

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

    所以唯一要做的就是在你的项目中添加这个键(现在更好,这样你就不会忘记),这样它就会被包含在内 in your next update 中 .

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

  • 3

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

    <NSLocationAlwaysUsageDescription>
    

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

    希望这可以帮助 .

  • 6

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

相关问题