App rejected due to UIBackgroundModes

Hello,

Our app gets rejected by Apple multiple times because of the use of location in UIBackgroundModes:

Your app declares support for location in the UIBackgroundModes key in your Info.plist file but still 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. Specifically, we were unable to locate features within the app that needs to use location in the background.

Our answer in the Resolution Center was this:

This app is monitoring UUID’s to detect iBeacons in the background. The proces is as following:

  1. When the device is in range of an iBeacon, the app is activated in the background by a call on the delegate function ‘didEnterRegion’ from CLLocationManager.

  2. The app starts ranging for iBeacons to detect the Major and Minor.

  3. The app uses that information to know which desk this is and connects with the BLE Dongle in the desk.

  4. Finally it sends the preferred height of the user to the BLE Dongle, which will result in the desk moving to that height.

This all is happening in the background, without requiring the user to open the app. The "location" setting in the UIBackgroundModes key is needed to detect the iBeacon.
So in summary, our app needs to detect an iBeacon in the background and for that needs the location background mode. But Apple keeps persisting that we don't need it.

When we remove the background mode and test the app in background, the process of detecting beacons is stopped.

In the info.plist it's like this:
Code Block     
<key>UIBackgroundModes</key>
    <array>
        <string>bluetooth-central</string>
        <string>location</string>
    </array>


The bluetooth-central background mode is needed to connect with a BLE device.

Is there something wrong with our setup, or do we need some different way of explaining this to Apple?
An app does not need the location background capability to detect entry/exit to beacon regions. It seems to me that you are using the location background capability in order to enable beacon ranging in the background past the short duration the app will be given after the beacon entry event.

Beacon ranging is not a background supported API, which is why you are needing this location workaround to be able to keep the app alive past the duration it will normally be active before it gets suspended.

This seems like an unnecessary middle step. Technically, your app can start scanning for the BLE Dongle peripheral directly after it enters the region. Once it starts the scan, it will be woken up when it detects the advertisement of the BLE Dongles. At that point you can try to recognize which desk it is by the specific information from the BLE Dongle. If that is not possible, then you can try ranging once more.


have you solved this problem ?

App rejected due to UIBackgroundModes
 
 
Q