在 IBeacon Android 中"If two apps register ranges with the same id, they clobber eachother"是什么意思



我只是从IBeacon开始。IBeacon Android中指定了一个问题,"如果两个应用程序使用相同的 id 注册范围,它们会相互干扰"。我对此没有完全的想法。

如果有人知道这件事,请帮助我。

你不需要担心这个。 理论上,如果两个应用程序共享Android iBeacon库的同一实例,并且它们在定义其区域对象时都传递了相同的唯一ID,则第二个应用程序将覆盖第一个应用程序的区域。

由于没有简单的方法可以使两个应用程序使用相同的服务实例,因此除了非常高级的用户之外,这不是一个实际问题。 我把它放在库的文档中,主要是作为对自己的注释,以便将来解决这个问题。

示例(不要这样做):

// 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); 

最新更新