Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Support iBeacons #31

Open
LouisCAD opened this issue Aug 10, 2016 · 2 comments
Open

Support iBeacons #31

LouisCAD opened this issue Aug 10, 2016 · 2 comments

Comments

@LouisCAD
Copy link

Hi,

The sample works only for Eddystone beacons, but I want to use some iBeacons that can't support Eddystone. Could this sample include support for them please?

Also, I must say what to put in "id" here for an iBeacon is not clear as iBeacons have 3 values, not one (an UUID, a major and a minor values).

@mashbridge
Copy link
Contributor

Hi Louis.

The way to add support for iBeacon would be to add a ScanFilter for it here https://github.com/google/beacon-platform/blob/master/samples/android/BeaconServiceDemoApp/app/src/main/java/com/google/sample/beaconservice/MainActivityFragment.java#L99, filtering on Apple's manufacturer data ID and the UUID of the beacons you're interested in.

The AdvertisedId field for the Proximity Beacon API just uses the concatenated UUID + major + minor of the iBeacon format. Take those 16 + 2 + 2 bytes as a byte array of length 20, then Base64 the it to get the string you send.

Make sense?

@LouisCAD
Copy link
Author

LouisCAD commented Aug 11, 2016

Hi mashbridge, thanks for your help!

Unfortunately, It's not enough to add a scan filter as the app must be able to recognize eddystone.
i'm currently using the code I found here, but I have yet to finish adding it to the sample successfully.

Why isn't this already included in the sample OOB?
Why require all developers to waste their time against this while it could just be a merged pull request?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants