allenlinli
allenlinli

Reputation: 2154

How to request geolocation in CLLocationManager with `requestAlwaysAuthorization` in iOS 13?

It seems like the user can not get the Always Allow option when the app request geolocation in CLLocationManager with requestAlwaysAuthorization in iOS 13. It shows Allow While Using App and Allow Once instead.

Environment: iOS 13 beta 6, Xcode beta 5, iPhone X

enter image description here

How can I prompt Always Allow to users?

Upvotes: 0

Views: 739

Answers (3)

Aleksey Sevko
Aleksey Sevko

Reputation: 66

It works correct. If user will press the best positive answer in that case which is Allow While Using App the operating system will remember that.System will present user alert at some point of time when some special event occurs. System will present alert with Keep Only While Using and Change to Always Allow options. For more information you can check on video from WWDC 2019 here from 2:40.

Upvotes: 5

Gowri K
Gowri K

Reputation: 55

Add these in the page which needs user location.

locationManager.requestWhenInUseAuthorization()
locationManager.requestAlwaysAuthorization()

Upvotes: 0

lukaskasa
lukaskasa

Reputation: 673

You probably need to include a description of all these keys in the info.plist.

enter image description here

Upvotes: 0

Related Questions