Appstore 连接错误:Info.plist 文件中缺少目的字符串
Error Appstore connect : Missing Purpose String in Info.plist File
我已将我的应用程序提交到 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
我的应用完全是用 Expo 构建的,我不知道如何访问和修改 Info.plist。
有什么想法吗?
我们确实收到了相同的电子邮件,但我们根本没有使用 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 Use" 和 "Always Use" 提供隐私说明。
这也是 Apple 的新功能,目前它只是一个警告,但从 Spring 2019 年开始,新提交将需要它。
出现此问题是因为您没有包含
<NSLocationAlwaysUsageDescription>
为您的应用。当我尝试在 AppStore 上提交我的应用程序时,我遇到了同样的问题。应用程序处理后,我收到了相同的邮件。我刚刚添加了说明,现在已解决。
希望对您有所帮助。
我在商店里有一些应用程序,我试图分发一个版本进行质量检查,但同样的事情发生在两个不同的应用程序中。
我认为这是接受构建上传到 Appstore connect 的新标准。
解决方法很简单,在.plist文件中添加如下几行。
<key>NSLocationAlwaysUsageDescription</key><br>
<string>自定义消息</string><br>
<key>NSLocationWhenInUseUsageDescription</key><br>
<string>自定义消息</string>
PS:在我的例子中没有使用任何位置功能,但我添加了这些行以符合 Appstore 连接指南。顺便说一句,在收到那封电子邮件后,我可以测试应用程序,即使他们说构建它有一些问题。
我希望这对你们有用。
编辑 2019 年 4 月:您现在必须添加这两个键,因为 spring 2019 年已经开始。请注意 NSLocationAlwaysUsageDescription
现在已弃用(自 iOS 11 起)并已被 NSLocationAlwaysAndWhenInUseUsageDescription
和 NSLocationWhenInUseUsageDescription
取代。如果要支持低于iOS 11,则必须使用这三个值。
总而言之你必须:
- 添加
NSLocationAlwaysAndWhenInUseUsageDescription
和 NSLocationWhenInUseUsageDescription
iOS 11 及更多
- 如果要支持 iOS 10 及以下
,请添加 NSLocationAlwaysUsageDescription
- 最后,如果你想支持 iOS 8 及以下,你可以添加
NSLocationUsageDescription
。
即使收到此消息,您也可以提交您的应用!
我昨天刚遇到同样的问题,即使应用程序没有使用定位功能。它可能与项目中包含的具有此可选功能的某些框架有关。
即使 info.plist
中没有 NSLocationAlwaysUsageDescription
和 NSLocationWhenInUseUsageDescription
键,我也可以确认我的应用已获批准
的确,正如 Apple 在邮件中所说的那样:
Starting spring 2019, all apps submitted to the App Store
that access user data will be required to include a purpose
string.
所以唯一要做的就是在你的项目中添加这个密钥(现在更好,这样你就不会忘记),这样它将包含在你的下一个更新中.
只需在您的 info.plist
中添加两个新条目,将 NSLocationAlwaysUsageDescription
和 NSLocationWhenInUseUsageDescription
作为键并简要说明为什么将它们用作值(即使您不不要真的使用它们...)。
##在 info.plist 文件中使用这个键
NSLocationAlwaysUsageDescription
xyz 福利需要您的位置 NSLocationWhenInUseUsageDescription
xyz 福利需要您的位置
这些答案都告诉你如何遵守 App Store 规则以避免警告,但真正的解决方法是 Expo 允许你禁用他们对位置服务的 SDK 要求,除非你实际使用它们 - 我是不确定这是否可能。
如果您使用的是 Expo,您可以通过将 infoPlist 添加到 app.json 来添加解决方案,如下所示:
"expo": {
"ios": {
"bundleIdentifier": "com.app.myapp",
"infoPlist": {
"NSLocationAlwaysUsageDescription": "Some message to appease Apple.",
},
},
}
有以下情况:
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。
我的应用程序也得到了,我什么也没做,但它可以运行很好,下次我认为应该在 plist 中添加这样的密钥,只是做一些描述
这是 Apple 的新要求,即使您不使用定位功能也是如此。如果要在 Xcode 中添加权限,请查找 "Privacy - Location Usage Description" 和 "Privacy - Location When In Use Usage Description" 并为它们各自键入自定义字符串。
为了更加简化,您可以在 info.plist 中添加这些行。这些错误的出现是因为从 2019 年 spring 开始,所有提交到 App Store 的访问用户数据的应用程序都需要包含一个目的字符串。
- 打开 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>
2 月 19 日出现相同问题,收到一封电子邮件,其中包含我未使用的一系列权限,我认为它们来自插件。 Apple 在 3 月 19 日表示这是一项要求,因此我将这些添加到 info.plst 并再次上传。
确实很傻。
我有
<key>NSLocationWhenInUseUsageDescription </key>
代替
<key>NSLocationWhenInUseUsageDescription</key>
一定要删除尾随空格
我也遇到了同样的问题,但是27小时后,我什么都没做就收到了关于批准的邮件。 所以等待大约 24 小时,而不是再次执行所有这些过程。
请查看您从 **App Store Connect ** 收到的电子邮件 **
找出丢失的钥匙
说明
打开 info.plist 文件。
从提供的选项中添加并搜索丢失的密钥(例如 联系人 = 隐私 - 联系人使用说明)
添加用法说明:
$(PRODUCT_NAME) needs Contacts access to "Provide The Reason Here".
示例:
用 Xcode 11 复制密钥 NSLocationAlwaysUsageDescription
并将其添加到 Info
-> Custom iOS Target Properties
-> 单击此左下方的 +
选项卡并作为值插入某种描述,例如 This app requires location access to function properly.
.
上述问题的简答-
NSLocationAlwaysUsageDescription
必须使用 Info.plist 文件
中的以下描述进行更新
{Your App Name} requires access to the location to suggest dengue
outbreak zones.
"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.
打开 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>
在我们的例子中,我们在我们的应用中使用了 NSLocationWhenInUseUsageDescription
,而不是 NSLocationAlwaysUsageDescription
。
阅读评论 here(感谢 matt-oakes),我们使用的依赖框架之一似乎正在使用 NSLocationAlwaysUsageDescription
。
运行 我们的应用程序没有显示实际的 NSLocationAlwaysUsageDescription 权限模式,所以它看起来只是在后台处理它。
所以总而言之,将 NSLocationAlwaysUsageDescription
添加到 Info.plist 修复了警告电子邮件,并且没有改变应用程序中的任何行为
我已将我的应用程序提交到 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
我的应用完全是用 Expo 构建的,我不知道如何访问和修改 Info.plist。
有什么想法吗?
我们确实收到了相同的电子邮件,但我们根本没有使用 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 Use" 和 "Always Use" 提供隐私说明。
这也是 Apple 的新功能,目前它只是一个警告,但从 Spring 2019 年开始,新提交将需要它。
出现此问题是因为您没有包含
<NSLocationAlwaysUsageDescription>
为您的应用。当我尝试在 AppStore 上提交我的应用程序时,我遇到了同样的问题。应用程序处理后,我收到了相同的邮件。我刚刚添加了说明,现在已解决。
希望对您有所帮助。
我在商店里有一些应用程序,我试图分发一个版本进行质量检查,但同样的事情发生在两个不同的应用程序中。 我认为这是接受构建上传到 Appstore connect 的新标准。
解决方法很简单,在.plist文件中添加如下几行。
<key>NSLocationAlwaysUsageDescription</key><br>
<string>自定义消息</string><br>
<key>NSLocationWhenInUseUsageDescription</key><br>
<string>自定义消息</string>
PS:在我的例子中没有使用任何位置功能,但我添加了这些行以符合 Appstore 连接指南。顺便说一句,在收到那封电子邮件后,我可以测试应用程序,即使他们说构建它有一些问题。
我希望这对你们有用。
编辑 2019 年 4 月:您现在必须添加这两个键,因为 spring 2019 年已经开始。请注意 NSLocationAlwaysUsageDescription
现在已弃用(自 iOS 11 起)并已被 NSLocationAlwaysAndWhenInUseUsageDescription
和 NSLocationWhenInUseUsageDescription
取代。如果要支持低于iOS 11,则必须使用这三个值。
总而言之你必须:
- 添加
NSLocationAlwaysAndWhenInUseUsageDescription
和NSLocationWhenInUseUsageDescription
iOS 11 及更多 - 如果要支持 iOS 10 及以下 ,请添加
- 最后,如果你想支持 iOS 8 及以下,你可以添加
NSLocationUsageDescription
。
NSLocationAlwaysUsageDescription
即使收到此消息,您也可以提交您的应用!
我昨天刚遇到同样的问题,即使应用程序没有使用定位功能。它可能与项目中包含的具有此可选功能的某些框架有关。
即使 info.plist
NSLocationAlwaysUsageDescription
和 NSLocationWhenInUseUsageDescription
键,我也可以确认我的应用已获批准
的确,正如 Apple 在邮件中所说的那样:
Starting spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.
所以唯一要做的就是在你的项目中添加这个密钥(现在更好,这样你就不会忘记),这样它将包含在你的下一个更新中.
只需在您的 info.plist
中添加两个新条目,将 NSLocationAlwaysUsageDescription
和 NSLocationWhenInUseUsageDescription
作为键并简要说明为什么将它们用作值(即使您不不要真的使用它们...)。
NSLocationAlwaysUsageDescription xyz 福利需要您的位置 NSLocationWhenInUseUsageDescription xyz 福利需要您的位置
这些答案都告诉你如何遵守 App Store 规则以避免警告,但真正的解决方法是 Expo 允许你禁用他们对位置服务的 SDK 要求,除非你实际使用它们 - 我是不确定这是否可能。
如果您使用的是 Expo,您可以通过将 infoPlist 添加到 app.json 来添加解决方案,如下所示:
"expo": {
"ios": {
"bundleIdentifier": "com.app.myapp",
"infoPlist": {
"NSLocationAlwaysUsageDescription": "Some message to appease Apple.",
},
},
}
有以下情况:
NSLocationAlwaysAndWhenInUseUsageDescription (iOS>11)
NSLocationWhenInUseUsageDescription (iOS>11)
NSLocationAlwaysUsageDescription (iOS<=10)
NSLocationUsageDescription (seems very old, iOS8?)
Apple 表示:
Add the
NSLocationWhenInUseUsageDescription
key and theNSLocationAlwaysAndWhenInUseUsageDescription
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。
我的应用程序也得到了,我什么也没做,但它可以运行很好,下次我认为应该在 plist 中添加这样的密钥,只是做一些描述
这是 Apple 的新要求,即使您不使用定位功能也是如此。如果要在 Xcode 中添加权限,请查找 "Privacy - Location Usage Description" 和 "Privacy - Location When In Use Usage Description" 并为它们各自键入自定义字符串。
为了更加简化,您可以在 info.plist 中添加这些行。这些错误的出现是因为从 2019 年 spring 开始,所有提交到 App Store 的访问用户数据的应用程序都需要包含一个目的字符串。
- 打开 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>
2 月 19 日出现相同问题,收到一封电子邮件,其中包含我未使用的一系列权限,我认为它们来自插件。 Apple 在 3 月 19 日表示这是一项要求,因此我将这些添加到 info.plst 并再次上传。
确实很傻。
我有
<key>NSLocationWhenInUseUsageDescription </key>
代替
<key>NSLocationWhenInUseUsageDescription</key>
一定要删除尾随空格
我也遇到了同样的问题,但是27小时后,我什么都没做就收到了关于批准的邮件。 所以等待大约 24 小时,而不是再次执行所有这些过程。
请查看您从 **App Store Connect ** 收到的电子邮件 **
找出丢失的钥匙
说明
打开 info.plist 文件。
从提供的选项中添加并搜索丢失的密钥(例如 联系人 = 隐私 - 联系人使用说明)
添加用法说明:
$(PRODUCT_NAME) needs Contacts access to "Provide The Reason Here".
示例:
用 Xcode 11 复制密钥 NSLocationAlwaysUsageDescription
并将其添加到 Info
-> Custom iOS Target Properties
-> 单击此左下方的 +
选项卡并作为值插入某种描述,例如 This app requires location access to function properly.
.
上述问题的简答-
NSLocationAlwaysUsageDescription
必须使用 Info.plist 文件
{Your App Name} requires access to the location to suggest dengue outbreak zones.
"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.
打开 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>
在我们的例子中,我们在我们的应用中使用了 NSLocationWhenInUseUsageDescription
,而不是 NSLocationAlwaysUsageDescription
。
阅读评论 here(感谢 matt-oakes),我们使用的依赖框架之一似乎正在使用 NSLocationAlwaysUsageDescription
。
运行 我们的应用程序没有显示实际的 NSLocationAlwaysUsageDescription 权限模式,所以它看起来只是在后台处理它。
所以总而言之,将 NSLocationAlwaysUsageDescription
添加到 Info.plist 修复了警告电子邮件,并且没有改变应用程序中的任何行为