Skip to main content

Background location access

What is the background location usage indicator?

The background location usage indicator (Blue Bar) is an iOS feature that allows an app to access location data when the user has selected While using the app location authorization and the app is in the background.

The background location usage indicator will be displayed as a blue pill or bar at the top of the screen – either behind the clock or across the status bar (the event display changes between iPhone models). This notification lets the user know that an app is accessing location data.

iOS background location usage indicator

info

If the user has selected the Always location authorization, the background location usage indicator will not be displayed.

When to use the background location usage indicator?

Background location usage indicator should be enabled when usage requires location updates even when the App is running in background and the user has granted the While using the app location authorization. 

How to set the background location usage indicator?

As per the documentation, enabling the background location usage indicator first requires that the app has enabled the location updates background mode:

If the location updates background mode is enabled, the background location usage indicator can be enabled and disabled by setting the backgroundLocationAccessForWhileUsing property in the BDLocationManager:

Enable background location usage indicator:     

BDLocationManager.instance().backgroundLocationAccessForWhileUsing = isOn

The default value of backgroundLocationAccessForWhileUsing is false, and it can be disabled while the app is either in the foreground or the background.

Background location use cases

It may be beneficial to switch the background location usage indicator on and off during app operation to maximise location data availability during mission-critical flows.

For example: 

On an app that handles ordering and pickup there may be value in starting Bluedot Geo-triggering on app start without the background location usage indicator enabled in order to power a marketing use case when the user grants Always location authorization or is actively using the app. When the user places an order and there is greater necessity and value in collecting location data to maximise the likelihood the user is detected upon arrival at the collection point, the background location usage indicator should be enabled. Upon completion of the order and collection process, the background location usage indicator should be disabled, removing unauthorized background location data collection and the visible indicator.

Example steps to implement:

  1. Start Geo-triggering without background location usage indicator enabled.
  2. User places an order.
  3. Enable background location usage indicator.
  4. User travels to the pickup location.
  5. Order is completed.
  6. Disable background location usage indicator.