【发布时间】:2014-11-08 20:31:48
【问题描述】:
我正在使用 iOS/xamarin 应用程序。 (iOS 8)。 我正在使用本教程来了解用户位置: http://www.themethodology.net/2014/10/getting-permission-to-access-user.html
以下代码可用于了解用户是否启用了位置服务以及应用程序是否有权使用该位置。
CLLocationManager clm = new CLLocationManager ();
public bool LocationServicesEnabled {
get {return CLLocationManager.LocationServicesEnabled;}
}
public bool IsAuthorized {
get {return CLAuthorizationStatus.Authorized == _authstatusLast;}
}
但是,如果用户第一次选择:不允许,之后,他将权限更改为:
Privacy >> Location >> MyApp >> ON
IsAuthorized 方法总是错误的。
有人知道如何解决这个问题吗?
【问题讨论】: