问题描述
iBeacon突然停止在iOS8中工作。在以前的iOS 8版本中它运行良好之前。有人帮我解决了这个问题吗?
iBeacon suddenly stopped working in iOS8. Before it was working fine in previous iOS 8 versions. Anybody help me to come out from this problem?
有什么问题,谢谢
推荐答案
您需要做的是在代码中添加访问位置服务的请求权限,如下所示:
What you need to do is to add request permission for accessing location services in the code, like the following:
if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
[self.locationManager requestAlwaysAuthorization];
}
另外,在你的app info.plist(AppName-info.plist)中,通过单击信息属性列表旁边的+符号添加密钥NSLocationAlwaysUsageDescription。选择其类型为String,并添加可在警报中显示的任何字符串值以访问位置权限。
我希望这可以解决您的问题。
Also, in your app info.plist(AppName-info.plist), add the key "NSLocationAlwaysUsageDescription" by clicking on the '+' sign besides "Information Property List". Select its type as 'String', and add any string value that can be displayed in the alert to access location permission.I hope this solves your issue.
*注意:如果您正在构建自己的信标sdk并进行集成在应用程序中,请在应用程序的info.plist中添加键值对,而不是sdk的键值对。
David Young的链接也指向正确的方向,但问题是你在sdk的info.plist中添加了键值对
*Note: If you are building your own beacon sdk and integrating in the app, then please add key value pair in the info.plist of the app, and not that of the sdk.David Young's link also point in the right direction, but the problem was that you were adding key value pairs in the sdk's info.plist
这篇关于在iOS 8 Beacon中没有检测到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!