【问题标题】:Simple Estimote (iBeacon) Xamarin example not working简单的 Estimote (iBeacon) Xamarin 示例不起作用
【发布时间】:2014-10-15 11:24:33
【问题描述】:

我正在尝试从 Xamarin iPad 应用程序中检测 Estimote iBeacons,但从未触发过“DidRangeBeacons”事件。

locationManager = new CLLocationManager();
var beaconId = new NSUuid("B9407F30-F5F8-466E-AFF9-25556B57FE6D");
beaconRegion = new CLBeaconRegion(beaconId, "Test Region");

locationManager.DidRangeBeacons +=  ( sender, e) => {
foreach (var beacon in e.Beacons) {
    Console.WriteLine(beacon.Major +"-"+ beacon.Minor +": " + beacon.Proximity +" " + beacon.Accuracy);
    }
};

locationManager.StartRangingBeacons (beaconRegion);
Console.WriteLine ("Starting Ranging"); 

上面的代码在 ViewDidLoad 方法中运行。

我是否需要配置其他任何东西来检测 iBeacons?

代码在 iPad 上运行,标准 Estimote 应用检测到 iBeacons

【问题讨论】:

  • 你能举例说明你的意思吗?

标签: ios xamarin ibeacon estimote


【解决方案1】:

Location Services not working in iOS 8 所述,通过将“NSLocationAlwaysUsageDescription”或“NSLocationWhenInUseUsageDescription”添加到plist.info 文件中已解决此问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-01
    • 2015-11-23
    • 2016-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多