Swift2.3 code for Beacon detection

后端 未结 3 510
感情败类
感情败类 2020-12-15 15:00

We are in advanced stages of developing a Swift2.2 app and hence have decided to migrate to 2.3 in the interim and do the full Swift 3 migration later. However we are unable

相关标签:
3条回答
  • 2020-12-15 15:17

    Try constructing your location manager after the view loads. In other words, change:

    let locationManager = CLLocationManager()
    

    to

    let locationManager : CLLocationManager!
    

    And then add this to the viewDidLoad:

    locationManager = CLLocationManager()
    

    I have seen strange behavior with LocationManager constructed on initialization of a UIViewController.

    0 讨论(0)
  • 2020-12-15 15:33

    While I was testing beacon ranging, I downloaded multiple applications that I forgot to uninstall. After I uninstalled all beacon-related applications and re-installed just the needed applications, I was able to get ranging beacons to work.

    0 讨论(0)
  • 2020-12-15 15:35

    There are a number of anecdotal reports of beacon detection problems on iOS 10. Symptoms include:

    • Improper region exit events, especially when the app is in the background, followed by entry events if the shoulder button is pressed.
    • Periodic dropouts in detections of ranged beacons, with callbacks providing an empty beacon list when beacons are in the vicinity.
    • Ranged beacon callbacks return proper results when a different beacon ranging or detection app is running that targets iOS 9.x.

    This is presumably a bug that will be fixed in an iOS update. Until then, some users have reported that setting the app deployment target in XCode to 9.x will resolve the issue.

    0 讨论(0)
提交回复
热议问题