what is mean by "If two apps register ranges with the same id, they clobber eachother" in IBeacon Android

StackOverflow https://stackoverflow.com/questions/19486541

Question

I just start with IBeacon. There is one is issue specified in IBeacon Android, "If two apps register ranges with the same id, they clobber eachother". I did not get perfect idea about this.

If anybody knows about this then please help me.

Was it helpful?

Solution

You don't need to worry about this. In theory, if two apps were sharing the same instance of the Android iBeacon Library, and they both passed the same unique id when defining their Region objects, the second app would overwrite the Region of the first app.

Because there is no easy way to make two apps use the same service instance, this is not a practical concern, except for very advanced users. I put this in the documentation for the library mostly as a note to myself to fix this in the future.

Example (don't do this):

// App 1
Region region1 = new Region("myUniqueId", "E2C56DB5-DFFB-48D2-B060-D0F5A71096E0", 1, 2);
iBeaconManager.startMonitoringBeaconsInRegion(region1);

// App 2 - the startMonitoring call will actually alter the region1 definition above
//         because the two Region objects have the same "myUniqueId" identifier
Region region2 = new Region("myUniqueId", "5A4BCFCE-174E-4BAC-A814-092E77F6B7E5", 3, 4);
iBeaconManager.startMonitoringBeaconsInRegion(region2); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top