Problems with connecting to IBeacon

2019-09-05 07:59发布

问题:

I am using the example from here to connect IBeacon. I believe that my UUID is correct. But the Event RegionEntered is never called and e.Beacons.Length in DidRangeBeacons event is always 0.

locationMgr.DidRangeBeacons += (object sender, CLRegionBeaconsRangedEventArgs e) => {
            var a = e.Region;
            if (e.Beacons.Length > 0) {
           //make notification
         }
}

The difference from above mentioned sample is that I use the IBeacon instead of IPad.

回答1:

Check to be sure you know the ProcimityUUID of your beacon by using the Locate app for iOS. You will need to configure the app with your ProximityUUID.

If the app will not detect your beacon, the beacon may be misconfigured or you may not have the proper UUID.

EDIT: I have added instructions for how to scan for your ProximityUUID here.