Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not registering iBeacon advertisment #28

Open
warrenronsiek opened this issue Dec 13, 2016 · 3 comments
Open

Not registering iBeacon advertisment #28

warrenronsiek opened this issue Dec 13, 2016 · 3 comments

Comments

@warrenronsiek
Copy link

Hi, I'm trying to use react-native-ble on an Iphone to detect IBeacons. When I do this using plain noble on my computer I get advertisements that look like this:

{
  localName: undefined,
  txPowerLevel: undefined,
  manufacturerData: <Buffer 4c 00 02 15 4e dc e9 15 9f bb 61 8b 47 f6 f2 03 bb dd 08 9a 3e fc ce 24 b8>,
  serviceData: [],
  serviceUuids: []
}

This is what I would expect. The first hex in the buffer corresponds to Apple's company identifier, and I verified that the uuid embedded in the buffer is the same as the one I'm advertising via IBeacon.

However, when I do this in a react native app (i.e. scanning with react-native-ble) and simply logging the results, the advertisement key is empty. However, it seems to work for non-IBeacon advertisments. E.g.

{ serviceData: 
   [ { uuid: 'fe9a',
       data: 
        { '0': 0, '1': 59, '2': 161, '3': 252, '4': 29, '5': 204, '6': 106, '7': 38,
          '8': 158, '9': 101, '10': 77, '11': 211, '12': 255, '13': 23, '14': 229,
          '15': 134, '16': 11, '17': 145, '18': 68, '19': 64 } } ],
  serviceUuids: [ 'fe9a' ]
}

This is the advertisement for some other bluetooth thing in my house. (Not sure exactly what it is).

I have tried detecting the IBeacons both in my own app and in the 'advertisement-discovery' example app, and the same problem happens: react-native-ble discovers things, but IBeacons advertisements are missing. What is going wrong here? Why can't react-native-ble detect IBeacon advertisements?

@rclai
Copy link
Contributor

rclai commented Dec 14, 2016

Apple doesn't let you detect iBeacon advertisements using the CBCentralManager, you have to use a completely different API. There's a React Native library that wraps that API already here.

@warrenronsiek
Copy link
Author

Wow. I'll have to send Apple a card thanking them for keeping things simple and being so flexible...

If it is possible to expand 'react-native-ble' to cover the other API, then you can consider this a feature request. Otherwise you can close this.

@jacobrosenthal
Copy link
Owner

The original goal behind this implementation was to track the noble api, what we need is a new (separate) bleno shim ;)

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

No branches or pull requests

3 participants