苹果拒绝,因为 UIBackgroundMode = location

问题描述:

我提交了一个应用程序,它以用户选择的固定时间间隔(5 分钟、10 分钟、30 分钟、1 小时)跟踪用户的位置(并将其发送到服务器).该应用程序也应该在后台运行(发送请求),我已将其声明为 UIBackgroundMode = location.我能够以这些固定的时间间隔在后台发送请求.苹果拒绝了它,建议如下:

I submitted an app which tracks the user's location (and sends it to the server) at some fixed intervals chosen by the user (5 min, 10 min, 30 min, 1 h). The app should work in background, too (sending the requests) and I have declared it as UIBackgroundMode = location. I am able to send the requests while in background at those fixed intervals. Apple rejected it, suggesting the following:

我们发现您的应用使用了后台模式但不包括需要该模式持续运行的功能.这个行为不符合 App Store 审核指南.

We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines.

我们注意到您的应用声明支持位置UIBackgroundModes 键在您的 Info.plist 但不包括功能需要持久的位置.

We noticed your app declares support for location in the UIBackgroundModes key in your Info.plist but does not include features that require persistent location.

添加需要持续使用的功能是合适的应用程序在后台时的实时位置更新或从 UIBackgroundModes 键中删除位置"设置.如果你的应用程序不需要持久的、实时的位置更新,我们建议使用显着变化的位置服务或区域监控定位服务.

It would be appropriate to add features that require persistent use of real-time location updates while the app is in the background or remove the "location" setting from the UIBackgroundModes key. If your application does not require persistent, real-time location updates, we recommend using the significant-change location service or the region monitoring location service.

有关这些选项的更多信息,请参阅启动显着变化定位服务"和基于形状的监测区域"部分.

For more information on these options, please see the "Starting the Significant-Change Location Service" and "Monitoring Shape-Based Regions" sections in the Location Awareness Programming Guide.

如果您选择添加使用位置背景模式的功能,请包括以下电池使用免责声明应用说明:

If you choose to add features that use the Location Background Mode, please include the following battery use disclaimer in your Application Description:

"继续使用后台运行的GPS可以显着减少电池寿命."

"Continued use of GPS running in the background can dramatically decrease battery life."

如果我更改了重要的位置更改并从 Info.plist 中删除了 UIBackgroundMode 键,应用程序将在后台被杀死,并且只有在事件发生时才会唤醒.但是我必须每 5 分钟向服务器发送一次请求,并且我的应用程序在后台被杀死(假设用户没有移动并且事件不是 trigger = no 请求被发送到服务器).

If I change significant location change and remove UIBackgroundMode key from Info.plist, the app will be killed in background and will wake up only if the event occurs. But I must send the request to server every 5 minutes for example and my app is killed in the background (let's say the user does not move and the event is not trigger = no requests are sent to server).

听起来像苹果的抱怨是你的苹果认为你的应用不需要使用后台位置.如果您尝试做的事情是合法的 - 例如您的用户希望应用在后台跟踪他们,这对他们来说很有用 - 您可以尝试在评论说明中解释为什么需要位置跟踪.

Sounds like apple's complaint is that your apple think that your app doesn't need to use background location. If what you're trying to do is legitimate - e.g. your user would expect the app to track them in the background and this is a useful thing to them - you could try explaining why location tracking is needed in the review notes.