Search code examples
androidioshardwareibeaconandroid-ibeacon

Does apple require you to have some special chip for iBeaons?


While playing around with iBeacon simulators, I noticed this :

*Android phones can recognize iBeacons irrespective of the device simulating the iBeacons(iOS and Android)

*iPhones can recognize iBeacons only if the simulating device is also an iPhone.

Why is that? is it a hardware thing?


Solution

  • There is no hardware or operating system dependency on iBeacon. You may transmit an iBeacon packet from Android, iOS, MacOS, Linux, Windows 10 and many embedded platforms.

    Here's a photo showing a transmission from an Android Nexus 5X and a detection on an iPhone 6:

    android transmitting ibeacon to ios

    There is no special trick here, but it is certainly possible to screw things up so it doesn't work. The two most common pitfalls are:

    1. The transmitter must be set to use the Apple Bluetooth LE manufacturer code 0x004c

    2. The transmitter must be sending the same ProximityUUID (aka ID1) that the iOS receiver is set to detect using a configured CLBeaconRegion.

    The setup above uses the BeaconScope app on Android (using the Android Beacon Library to transmit iBeacon) and the Locate app (using CoreLocation to detect iBeacon) on iOS.

    Using the AndroidBeaconLibrary, setting up this transmitter is as simple as this:

        Beacon beacon = new Beacon.Builder()
                .setId2(1) // Major for beacon
                .setId3(1) // Minor for beacon
                .setManufacturer(0x004C) // Apple
                .setTxPower(-56) // Power in dB
                .build();
    
        BeaconParser beaconParser = new BeaconParser()
                .setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24");
    
        transmitter = new BeaconTransmitter(context, beaconParser);
        transmitter.startAdvertising(beacon, new AdvertiseCallback() {
            @Override
            public void onStartFailure(int errorCode) {
                Log.i(Settings.DEBUG, "Advertisement start failed with code: " + errorCode);
            }
        });