C# altBeacon未检测到信标

C# altBeacon未检测到信标,c#,xamarin,beacon,C#,Xamarin,Beacon,我只是想实现altbeacon库。我的问题是永远不会调用回调方法。我就是找不到我的信号灯。我为BeaconManager尝试了几种不同的布局,但没有成功。谁能告诉我我做错了什么?也许我交给BeaconManager的区域有问题?altbeacon在哪里使用区域的第一个参数(java.lang.String uniqueId、标识符id1、标识符id2、标识符id3)?我为其他每个参数传递null,因为我不想找到特定的信标 namespace DMSBeacon { [Activity(L

我只是想实现altbeacon库。我的问题是永远不会调用回调方法。我就是找不到我的信号灯。我为BeaconManager尝试了几种不同的布局,但没有成功。谁能告诉我我做错了什么?也许我交给BeaconManager的区域有问题?altbeacon在哪里使用区域的第一个参数(java.lang.String uniqueId、标识符id1、标识符id2、标识符id3)?我为其他每个参数传递null,因为我不想找到特定的信标

namespace DMSBeacon
{
    [Activity(Label = "Altbeacon")]
    public class AltbeaconActivity : Activity, IBeaconConsumer,     IDialogInterfaceOnDismissListener
    {
        private BeaconManager oBeaconManager;
        private MonitorNotifier oNotifier = new MonitorNotifier();
        private RangeNotifier oRangeNotifier = new RangeNotifier();

        public class RangeNotifier : IRangeNotifier
        {
            public IntPtr Handle
        {
            get
            {
                //throw new NotImplementedException();
                return new IntPtr();
            }
        }

        public void DidRangeBeaconsInRegion(ICollection<Beacon> beacons, Region region)
        {
            throw new NotImplementedException();
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }


    public class MonitorNotifier : IMonitorNotifier
    {
        public IntPtr Handle
        {
            get
            {
                //throw new NotImplementedException();
                return new IntPtr();
            }
        }
        public void DidDetermineStateForRegion(int state, Region region)
        {
            Android.Util.Log.Info("TEST", "I have just switched from seeing/not seeing beacons: " + state);
        }

        public void DidEnterRegion(Region region)
        {
            Android.Util.Log.Info("TEST", "I just saw an beacon for the first time!");
        }

        public void DidExitRegion(Region region)
        {
            Android.Util.Log.Info("TEST", "I no longer see an beacon");
        }
        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }
    public void OnBeaconServiceConnect()
    {
        oBeaconManager.SetRangeNotifier(oRangeNotifier);
        //oBeaconManager.SetMonitorNotifier(oNotifier);            
        oBeaconManager.StartRangingBeaconsInRegion(new Region("allbeacons", null, null, null));
        //oBeaconManager.StartMonitoringBeaconsInRegion(new Region("allbeacons", null, null, null));

    }
    protected override void OnDestroy()
    {
        base.OnDestroy();
        oBeaconManager.Unbind(this);
    }
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(Resource.Layout.notify);
        oBeaconManager = BeaconManager.GetInstanceForApplication(this);            
        oBeaconManager.BeaconParsers.Add(new BeaconParser()
           .SetBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));
        oBeaconManager.Bind(this);                       
    }

    public void OnDismiss(IDialogInterface dialog)
    {
        throw new NotImplementedException();
    }      
}

你有没有想找的AltBeacon兼容设备?我真的不知道我的信标是否与AltBeacon兼容,我有两个来自“Beacon Inside”的是iBeacon,一个来自Kontakt(我想也是iBeacon格式)。我已经尝试了信标区信标的布局(m:2-3=0215,I:4-19,I:20-21,I:22-23,p:24-24,d:25-25),但没有结果(上面的代码中没有调用任何方法)。啊,我看到了你对信标道具的编辑。。。那你应该没事了。我们有一大堆进口的(i)信标标签(只有硬件板,没有batt或机箱),在Android(基于Eddystone)下有很多故障(损坏的广告框),但它们在iPhone上运行良好。。。当然,较旧的Driod手机是一个问题(4.3/2?),在我们将电池插入所有手机后,它们的蓝牙都崩溃了(已知的android问题)。但仍然没有调用任何事件。还有什么问题吗?我周围没有任何信号灯可以尝试。。。您是否使用参考应用程序确认与AltBeacon绑定项目(从Xam组件商店)匹配的所有功能都正常工作?您是否有正在尝试查找的AltBeacon兼容设备?我不知道我的信标是否与AltBeacon兼容,我有两个来自“Beacon Inside”的设备,分别是iBeacon和一个来自Kontakt(我也认为iBeacon格式)。我已经尝试了信标区信标的布局(m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25),但没有结果(在上面的代码中没有调用任何方法)。啊,我看到了你对信标道具的编辑…那时你应该没事了。我们有一堆导入的(i)信标标签(只有硬件板,没有batt或机箱)在安卓系统(基于Eddystone)下出现了很多故障(损坏的广告框),但它们在iPhone上运行良好……当然,老式的Driod手机是一个问题(4.3/2?),在我们将电池插入所有手机后,它们的蓝牙系统崩溃(已知安卓系统问题).但是仍然没有调用任何事件。还有什么问题吗?我没有任何信标可供尝试…您是否使用参考应用程序来确认与AltBeacon绑定项目(来自Xam组件库)匹配的所有内容都正常工作
(12-23 09:46:30.455 D/bt_btif_gattc(12179): btif_gattc_update_properties BLE device name=BEACON D1:95:12 len=15 dev_type=2
12-23 09:46:30.519 D/bt_btif_gattc(12179): btif_gattc_update_properties BLE device name=Kontakt1234567 len=14 dev_type=2
12-23 09:46:30.658 D/bt_btif_gattc(12179): btif_gattc_update_properties BLE device name=Kontakt len=7 dev_type=2
12-23 09:46:30.699 D/bt_btif_gattc(12179): btif_gattc_update_properties BLE device name=BEACON D1:0C:AF len=15 dev_type=2)