Search Unity

How to let Unity request location authorization with "Always" flag?

Discussion in 'iOS and tvOS' started by waldgeist, Jul 13, 2019.

  1. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    In my app, I want to use two different location services:
    - the standard Unity location provider, if the app runs in the foreground
    - a background location service (native plugin), if the app runs in the background

    For the background service to work, I need to request access via "requestAlwaysAuthorization". However, Unity's location provider only requests "requestWhenInUseAuthorization". Is there a way to tell Unity it should ask for the "always" authorization level?

    I though this would happen automatically if you select the "background location" option in the background modes section of the player settings, but this did not do the trick.