2014-10-06 68 views
2

我一直在开发依赖于CoreLocation因为第1的Xcode上周我提交了它的测试上iTunes connect/TestFlight 6测试版的应用程序。该应用完全适用于开发设备,但是当我创建adhoc版本时,它不会要求授权。CoreLocation不工作的即席分布在iOS 8

细节:

  • Settings > General > Reset > Reset Location Warnings没有解决
  • 我设置的Info.plist
  • CoreLocation.framework NSLocationWhenInUseUsageDescription上Linked Frameworks and Libraries加入(但什么都没有改变,当我删除)
  • 我“M(使用CocoaPods)为MBProgressHUD
  • 我的ViewController是这样的:https://gist.github.com/thiagogabriel/d0120547565c91089b72
  • 我最近改变了产品名称为小写
  • 我开始从头开始一个新项目,它发生在相同的即席进行内部测试
+0

我看到了这一点。到目前为止,我的想法可能与TestFlight相关。我可能会尝试HockeyApp或其他Ad Hoc分发设置。 – 2014-10-10 19:48:58

+0

通过“完美的作品上进行开发的设备”你的意思是它适用于开发建立,甚至是生产建筑工作在登记在开发者计划的设备? – 2014-10-10 19:51:24

+0

@MarcoPompei当我使用电缆进行测试时,它可以工作。所述自组织的情况下是完全一样[这里](http://code.tutsplus.com/tutorials/ios-8-beta-testing-with-testflight--cms-22224) – 2014-10-10 21:43:02

回答

1

更改此代码:

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) 
    } 
} 

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) 
    } 
} 

此更新解决您的问题。

相关问题