- Home /
iBeacon monitoring
I tried to use the provided example to monitor some iBeacons; however the code seems to be generating a random UUID and not using the designed string (proximityUUID). The code
beaconRegion = new CLBeaconRegion(new NSUUID(proximityUUID), 1, 1, beaconID);
seems to generate a new UUID instead of using the one specified by the code. In fact, monitoring beaconRegion from Xcode with
Debug.Log("BEACON REGION " + beaconRegion);
gives different results every time it's called upon....
BEACON REGION [CLBeaconRegion: Uuid=C6F1C598-58D5-4C4E-8C74-360D56618CFC] BEACON REGION [CLBeaconRegion: Uuid=EFCDED59-D111-46D8-B997-89FCFBF76DFF]
etc. which are all different from the beacon specified in the code and I'm supposed to monitor....
Question is: how do you monitor the beacon whose UUID is assigned to the string proximityUUID ?
Answer by u3dxt · May 14, 2014 at 08:40 PM
Hi, the "Uuid" printed out in the CLBeaconRegion is not the NSUUID passed into the constructor. We use the "Uuid" as an internal way to identify native objects from Unity. You can safely ignore the "Uuid" printed out there. If you want to get the NSUUID passed in to the constructor, you can use beaconRegion.proximityUUID.UUIDString().
To monitor a beacon, you would use the same CLBeaconRegion. If you look at the example code, the same CLBeaconRegion is used in both the advertising and monitoring code.
Hope this clarifies it.
Your answer
Follow this Question
Related Questions
TurnChanged is not fired always. 1 Answer
Attention U3DXT - Help Needed Urgently 0 Answers
Game controller example? 0 Answers
IOS SDK Pro, get current OS language 1 Answer
U3DXT iOS plugin proximity sensor causing screen to go black? 0 Answers