You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Location Services prompt disappears too soon #1930
A fresh install of iosapp on iOS 9 displays a Location Services prompt for “Always” permissions, but this prompt disappears after a second without any user intervention. Then if you hit the user location tracking button, a “When in Use” prompt appears, so iosapp has no access to background location updates. If at some point you revoke iosapp’s “When in Use” permission, pressing the user location tracking button does nothing.
#1909 either appears to be unaffected (or fixes this problem). Pushing the location button in the demo app brings up the permission dialog as expected using both WhenInUse and Always.
The problem here is that the demo app is trying to restoreState: on the first run, which is clobbering the .showsUserLocation = YES permissions dialog.
It's generally good practice to delay asking for permissions or only do so when the user really needs/wants those permissions. As the permissions dialog blocks our map from loading, I'm going to set .showsUserLocation = YES some point later, after the map has loaded.
Activity
[-]iOS 9: Location Services prompt disappears too soon[/-][+]Location Services prompt disappears too soon[/+]1ec5 commentedon Jul 24, 2015
Also reproduces on iOS 8.4.
friedbunny commentedon Jul 24, 2015
#1909 either appears to be unaffected (or fixes this problem). Pushing the location button in the demo app brings up the permission dialog as expected using both
WhenInUseandAlways.friedbunny commentedon Jul 24, 2015
This is something we've left up to developers to handle in the
didFailToLocateUserWithError:delegate method, for now. Should probably move in-house.friedbunny commentedon Sep 4, 2015
This may have been fixed by #1909, but I'm going to confirm that before closing this.
friedbunny commentedon Sep 4, 2015
Nope, not fixed.
friedbunny commentedon Sep 4, 2015
The problem here is that the demo app is trying to
restoreState:on the first run, which is clobbering the.showsUserLocation = YESpermissions dialog.It's generally good practice to delay asking for permissions or only do so when the user really needs/wants those permissions. As the permissions dialog blocks our map from loading, I'm going to set
.showsUserLocation = YESsome point later, after the map has loaded.friedbunny commentedon Sep 4, 2015
mapViewDidFinishLoadingMap:would be a good place to do this, except it's not hooked up — #2263.incanus commentedon Sep 4, 2015
I'm not generally into timers, but in the interest of simplicity, maybe just set
showsUserLocation = YESa second afterviewDidAppear:?Update NSLocationWhenInUseUsageDescription string
Update NSLocationWhenInUseUsageDescription string