Closed SebastianKotewitz closed 4 years ago
The uuids should be unique. Also the ones you have so I think it is not the correct field. The UUID is part of the iBeacon package that is sent out, which we (in the old app) were able to get through a iBeacon library to iOS and android. This way you can avoid having to call /beacons to match the beacon name with an id and instead just send the uuid directly. But now that I look at it, it doesn't seem like you can see the iBeacon package with the Flutter Blue library. Maybe we need to investigate this further or just have the beacon names (the short 4 letter name) be unique and make the server match the name with the beacon.
If we decide to have the beacon names be unique, it would cause an issue if one beacon is used in 2 or more buildings (Very specific case where two neighbouring buildings are close together), as one beacon can only have one building. This is why we used _id as the primary key. The algorithm determining the building is also already setup to choose the building via bluetooth based on all scanned beacons and what building is referenced the most by these. This takes duplicate beacons with the same name but different _id and thus different buildings into account.
Adding multiple beacons to one building fails, as the beacons require a unique UUID by the server. The UUID of the 4 beacons I have are the same, or, at least the field where the UUID is taken is. It is currently taken from the advertisementData.serviceData.keys.first, which seems to be the only field matching the structure required by the database.