AltBeacon - Eddystone-URL 传输和 Chrome 物理网的问题

AltBeacon - Problems with Eddystone-URL transmitting and Chrome Physical Web

我正在尝试使用以下代码传输 Eddystone-URL:

try
{
    byte[] urlBytes = UrlBeaconUrlCompressor.compress("http://google.com");
    Identifier encodedUrlIdentifier = Identifier.fromBytes(urlBytes, 0, urlBytes.length, false);
    ArrayList<Identifier> identifiers = new ArrayList<Identifier>();
    identifiers.add(encodedUrlIdentifier);
    Beacon beacon = new Beacon.Builder()
            .setIdentifiers(identifiers)
            .setManufacturer(0x0188)
            .setTxPower(-7)
            .build();
    BeaconParser beaconParser = new BeaconParser().setBeaconLayout(BeaconParser.EDDYSTONE_URL_LAYOUT);
    BeaconTransmitter beaconTransmitter = new BeaconTransmitter(getApplicationContext(), beaconParser);
    beaconTransmitter.setAdvertiseTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH);
    beaconTransmitter.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY);
    beaconTransmitter.startAdvertising(beacon, new AdvertiseCallback()
    {
        @Override
        public void onStartFailure(int errorCode)
        {
            Log.e(TAG, "Advertisement start failed with code: " + errorCode);
        }

        @Override
        public void onStartSuccess(AdvertiseSettings settingsInEffect)
        {
            Log.i(TAG, "Advertisement start succeeded.");
        }
    });
}
catch (MalformedURLException e)
{
    Log.d(TAG, "That URL cannot be parsed");
}

我可以使用此应用在我的第二台设备上看到传输的信标:https://play.google.com/store/apps/details?id=com.uriio&hl=pl

但是在我第二台设备上的 Chrome 物理网中看不到这个信标。当我使用 BeaconToy 应用程序传输 Eddystone-URL 信标时,我的第二台设备在 Chrome Physical Web 和 BeaconToy 中都找到了这个信标。

我的传输代码中有问题还是 altbeacon 中的错误?

这是 Android Beacon 库 2.8.1 中新发现的错误。已提出修复方案,并计划在本周末发布。详情请看这里:

https://github.com/AltBeacon/android-beacon-library/pull/401