Is there a way to trigger the .always coreLocation permission proactively in iOS13?

前端 未结 3 1536
萌比男神i
萌比男神i 2021-02-06 10:36

Under iOS13, when you request the .always permission for coreLocation (to enable background location e.g. for geofences or iBeacons), the app is only granted a \"provisional alw

3条回答
  •  孤城傲影
    2021-02-06 10:48

    To see the second dialog with the Allow Always prompt you have to:

    1. Disable the blue indicator.
    2. Go to the background.
    3. Wait at least 5 seconds.
    4. Try to get a location update or use any other core location service.
    5. Wait until the user locks and unlocks the device.

    To facilitate this, you can set the distance filter to none and start getting continuous location updates.

    If you want the location updates to be delivered in the background, then you have to show the blue indicator. And then the second dialog requesting Allow Always would never appear.

提交回复
热议问题