octavioturra / react-native-alt-beacon

A work-in-progress lib to work with AltBeacon and React Native.
MIT License
34 stars 10 forks source link

Why does minSdkVersion have to be 21? #8

Open andrekovac opened 8 years ago

andrekovac commented 8 years ago

How did you find out about this restriction? Via trial and error? Or is there some documentation that react-native only supports BLE-signals from SDK version 21, i.e. for Android version 5.0 and up?

joustava commented 8 years ago

Seems that native Android supports BLE from at least 18 onwards read this for details.

andrekovac commented 8 years ago

@joustava : That's exactly the reason why I'm asking the question. Native Android supports BLE from 18 (4.3) onwards, but this package only works for version 21 onwards.

Have you got any idea why that could be the case?

joustava commented 8 years ago

@Andruschenko this restriction is because as of Android 5.0 (21) you can use your device as a beacon (transmitter). so prolly it also works with 18 if you don't use that feature. Haven't tried it.

andrekovac commented 8 years ago

@joustava Thanks for pointing that out. Currently I'm implementing a bridging module for a different beacon API. I'm not using any transmitting feature but it also only works for Android 21 and above. @octavioturra Is the transmitting feature the reason for your restriction to version 21 and above?

joustava commented 8 years ago

@Andruschenko after looking a little further: this search shows the different targets. This repo depends on that library. Haven't looked at this repos source, but I suspect it doesn't need to be 21 as long as it is made sure that you don't use features that the device doesnt support. alt beacon build settings

andrekovac commented 8 years ago

@joustava Thanks! I'll look further into it and give it another try. The weird thing is that it didn't work in my implementation of the other beacon API (Kontakt.io beacons) when I set the build target to 18.. Hopefully I'll find some time next week to try it again!

mmazzarolo commented 8 years ago

Hey there! I can confirm that 18 should be enough, I'm using one implementation of the AltBeacons SDK for RN and it works fine on Android < 5 (should be 4.4 I think).

Edit: also @Andruschenko I lurked a bit your repos and I saw that you've created a module for detecting Kontakt beacons using the Kontakt SDK... may I ask you why? Doesn't the Alt Beacons SDK work for them too? Just asking, I'm developing a module too and I still haven't tried it with Kontakt beacons but I thought that adding the right parser would have been enough 😓 Thank you in advance, sorry for the off thread discussion.

andrekovac commented 8 years ago

@mmazzarolo Thanks for the info!

concerning your question: The kontakt.io SDK offers some additional values like batteryPower, txPower, uniqueID (which is written on the back of the beacons). That's why I'm implementing the bridging module. I'm currently still facing an issue with npm and the here mentioned version issue.. If you don't need these additional values, Kontakt.io beacons work with the AltBeacon SDK in general, i've tested it.

mmazzarolo commented 8 years ago

@Andruschenko good to know, thank you!
Good luck with your project then :star: