iOS之后台持续始终定位权限被拒(2.5.4)

2023-02-06  本文已影响0人  贵叔勇闯天涯

由于持续使用定位功能被拒,现整理出解决方案

原文邮件:

Hello,
The issues we previously identified still need your attention.
If you have any questions, we are here to help. Reply to this message in App Store Connect and let us know.
Guideline 2.5.4 - Performance - Software Requirements
Your app declares support for location in the UIBackgroundModes key in your Info.plist file but does not have any features that require persistent location. Apps that declare support for location in the UIBackgroundModes key in your Info.plist file must have features that require persistent location.
Next Steps
To resolve this issue, please revise your app to include features that require the persistent use of real-time location updates while the app is in the background.
If your app does not require persistent real-time location updates, please remove the "location" setting from the UIBackgroundModes key. You may wish to use the significant-change location service or the region monitoring location service if persistent real-time location updates are not required for your app features.
Resources
For more information, please review the Starting the Significant-Change Location Service and Monitoring Geographical Regions.
译文:
你好,
我们之前发现的问题仍然需要你的关注。
如果你有任何问题,我们都会帮助你。在App Store Connect中回复这条消息并让我们知道。
指南2.5.4 -性能-软件要求
你的应用在信息中的UIBackgroundModes键中声明了对位置的支持。Plist文件,但不具有任何需要持久位置的特性。在信息中的UIBackgroundModes键中声明支持位置的应用程序。Plist文件必须具有需要持久定位的特性。
下一个步骤
要解决此问题,请修改您的应用程序,以包括需要在应用程序在后台持续使用实时位置更新的功能。
如果你的应用程序不需要持续的实时位置更新,请从UIBackgroundModes键中删除“location”设置。如果您的应用程序功能不需要持续的实时位置更新,您可能希望使用重大变化位置服务或区域监控位置服务。
资源
有关更多信息,请查看启动重大变更位置服务和监控地理区域。

从邮件的信息来看总结出两个:

1、如果继续使用始终定位权限,请在Plist文件询问定位权限时描述的更精确
2、如果不打算使用始终定位权限,请不要询问用户该权限且在UIBackgroundModes删除Location update这个配置。

我的解决方案:

由于我的应用开发地理围栏监控功能,所以需要让用户打开始终定位权限,以便在APP杀死后,仍然能够监听到用户进入到提前设置的监听位置,从而唤醒APP来做一些事情。所以我选择继续使用始终允许定位权限。关于更多iOS地理围栏的技术请参考:《iOS区域监测(地理围栏)技术》《iOS开发-电子围栏区域监听深入篇》
上一篇 下一篇

猜你喜欢

热点阅读