I've been developing an app that depends on CoreLocation since the first Xcode 6 beta 1. Last week I submitted it for test on iTunes connect/TestFlight. The app works perfectly on develop devices, but when I create adhoc version, it doesn't ask for authorization.
The details:
Settings > General > Reset > Reset Location Warnings
didn't solveLinked Frameworks and Libraries
(but nothing changed when I remove)Change this code:
func askForLocation(sender: AnyObject) {
if (locationStatus == CLAuthorizationStatus.Denied) {
let url = NSURL.URLWithString(UIApplicationOpenSettingsURLString)
UIApplication.sharedApplication().openURL(url)
} else if (locationStatus != CLAuthorizationStatus.AuthorizedWhenInUse) {
locationManager.requestWhenInUseAuthorization()
} else if (locationStatus == CLAuthorizationStatus.AuthorizedWhenInUse){
self.performSegueWithIdentifier("seguePlaceViewController", sender: sender)
}
}
to
func askForLocation(sender: AnyObject) {
locationManager.requestWhenInUseAuthorization()
if (locationStatus == CLAuthorizationStatus.Denied) {
let url = NSURL.URLWithString(UIApplicationOpenSettingsURLString)
UIApplication.sharedApplication().openURL(url)
} else if (locationStatus == CLAuthorizationStatus.AuthorizedWhenInUse){
self.performSegueWithIdentifier("seguePlaceViewController", sender: sender)
}
}
This update solves your problem.