简体   繁体   中英

iOS13 Provisional Location Permission

Since apple has deferred the "Always Allow" permission and only OS can and will ask for that permission based on its own convenience, it is hard to understand what all the scenarios are.

If you see the WWDC video: https://developer.apple.com/videos/play/wwdc2019/705/

The guy clearly says at 04:14, "you ask for requestAlwaysAuthorization, apple provides you with the max option of "While In Use", but at the same time the delegate callback says, the app has "Always Allow permission"". This works as expected, and my app gets the location updates, only If I keep it opened. At 04:35 he says, start Geofence activity as a background-tracking/always-allow requirement. This is where it confuses me, If I put my app in background, location updates are stopped. Why am I asked to setup a geofence for a user who is already in motion even when my delegate call back received "Always Allow" permission?

At 05:22, the pop up which solidifies the provisional always allow permission only comes up (at OS convenience), when you lock the device and unlock it, after putting it in the background as discussed in above paragraph. But all the data in between is lost. My app tracks user's trips and this will completely kill the valid use case of recording user's movement in a vehicle.

Even if I follow the video and create a geofence when app goes to the background and then start to move, nothing happens until I lock and unlock the device. This seems to be pretty useless.

Why am I asked to setup a geofence for a user who is already in motion even when my delegate call back received "Always Allow" permission?

You're not. You've misunderstood the video. He gives that as an example of using Always powers. It's just an example.

At 05:22, the pop up which solidifies the provisional always allow permission only comes up (at OS convenience), when you lock the device and unlock it, after putting it in the background as discussed in above paragraph. But all the data in between is lost.

No it isn't. Listen to what he says in the video. If the user now accepts Always, the withheld delegate message is delivered.

this will completely kill the valid use case of recording user's movement in a vehicle.

No it won't. That use case has nothing to do with anything you said previously. If your app is tracking location in the foreground and goes into the background with background location mode and keeps tracking, it is in use. So all you need for that is When In Use. So all that Always stuff is irrelevant to you.

That is the whole point of the video. Don't ask for Always unless you need it. If you do ask for it, use it, or you won't get it. But you, it appears, don't need it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM