iOS devices can't see Nexus 9 advertised AltBeacon beacon

711 views Asked by At

We have an iBeacon based ecosystem and want to expand it with Android advertising. We use the AltBeacon BeaconTransmitter class based on this blog post: http://developer.radiusnetworks.com/2014/11/18/beacon-transmission-with-android-5.html with the beacon layout mentioned in this thread: Is this the correct layout to detect iBeacons with AltBeacon's Android Beacon Library?

We use a Nexus 9 tablet for advertising, our other Android devices can see the advertised beacon, but the iOS devices not.

We create the beacon like this:

mBeaconTransmitter = new BeaconTransmitter(this, new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
            // Transmit a beacon with Identifiers 2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 1 2
            Beacon beacon = new Beacon.Builder()
                    .setId1("our uuid")
                    .setId2("a major id")
                    .setId3("a minor id")
                    .setManufacturer(0x0000)
                    .setTxPower(-59)
                    .setDataFields(Arrays.asList(new Long[] {0l}))
                    .build();

What can be the missing part? In the CL's didRangeBeacons method we can't see this beacon.

1

There are 1 answers

4
davidgyoung On BEST ANSWER

The Android Beacon Library's new BeaconTransmitter class requires that the new BeaconParser.setBeaconLayout() expression be exactly right for the beacon type you wish to transmit.

Two things about the code look suspicious:

  1. The code calls setDataFields() on the beacon even though no data fields are defined in the beacon layout expression (with a d: prefix). This should probably cause an exception, but if it does not, it could be screwing up the transmission. I would remove this.

  2. I am not sure if a manufacturer code of 0x0000 is valid. If (1) does not solve the problem, try different manufacturer codes to find one that works with iOS.

Just to verify there is no problem with the Nexus 9 hardware, try running the free QuickBeacon app in the Google Play store. It uses the exact same APIs to transmit, so if it works you should be able to make your code work, too.