In iOS 8 Beacon not detecting

无人久伴 提交于 2019-12-24 03:19:30

问题


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 is the problem, Thanks


回答1:


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];
}

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.


*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




回答2:


You need to implement a new permissions model for beacons on iOS 8 building with XCode 6. See here: See here:

Location Services not working in iOS 8




回答3:


just add following in to your viewdidload its works for me..

[locationManager requestWhenInUseAuthorization]; [locationManager requestAlwaysAuthorization];



来源:https://stackoverflow.com/questions/25978648/in-ios-8-beacon-not-detecting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!