0

In other devices work and the dialogue appears for permission to access location (All devices iOS 7 and iOS 8), but the iPhone 5 with iOS 8.1 not appear that request permission.

Code request permission:

var versionString = UIDevice.currentDevice().systemVersion.stringByReplacingOccurrencesOfString(".", withString: "", options: NSStringCompareOptions.CaseInsensitiveSearch, range: nil) as NSString
    if versionString.floatValue >= 800 {
        if CLLocationManager.authorizationStatus() != CLAuthorizationStatus.Authorized && CLLocationManager.authorizationStatus() != CLAuthorizationStatus.AuthorizedWhenInUse {

            if CLLocationManager.authorizationStatus() == CLAuthorizationStatus.Denied {
                    NSLog("Not Accepted")
            } else {
                locationManager.requestAlwaysAuthorization()
            }
        }
    } else {
        if CLLocationManager.authorizationStatus() == CLAuthorizationStatus.Denied {
            NSLog("Not Accepted")
        } else {
            locationManager.startUpdatingLocation()
            locationManager.stopUpdatingLocation()
        }
    }

The dialog of request not showing.

And declared on .plist NSLocationAlwaysUsageDescription type boolean and YES.

Chris
  • 7,270
  • 19
  • 66
  • 110
Gian
  • 1,193
  • 2
  • 8
  • 20
  • Not is duplicate, read question. – Gian Jan 14 '15 at 16:59
  • Look at the settings for the app on the iPhone 5? Is the permission already set? – rmaddy Jan 14 '15 at 17:13
  • If the dialog is not showing, are you failing with "Not Accepted" logged? You may have global location services turned off or that app already set to "Never". – Brian Nickel Jan 14 '15 at 17:19
  • 1
    NSLocationAlwaysUsageDescription should be a string of what message is shown to the user when requesting permission I believe. https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html – Mike Welsh Jan 14 '15 at 17:24
  • The app not showing this setting on tab of app. – Gian Jan 14 '15 at 17:24
  • Only key description string? nothing key boolean? – Gian Jan 14 '15 at 17:26

0 Answers0