react-native-kontaktio icon indicating copy to clipboard operation
react-native-kontaktio copied to clipboard

Android BeaconDidUpdate: Beacon's UniqueID is null

Open johnkennethfurog opened this issue 3 years ago • 9 comments

RN Version : 0.62.2 react-native-kontaktio Version: ^2.7.2

to detect beacons I am using this code :

    DeviceEventEmitter.addListener('beaconsDidUpdate', ({ beacons }) => {
      console.log('beaconsDidUpdate', beacons);
    });

    DeviceEventEmitter.addListener('beaconDidAppear', ({ beacon }) => {
      console.log('beaconDidAppear', beacon);
    });

upon detecting the beacon, the uniqueId is null :

beaconDidAppear {"accuracy": 0.12086380610771207, "address": "CD:D4:F2:28:2E:E1", "batteryPower": -1, "firmwareVersion": "-1", "isShuffled": false, "major": 36652, "minor": 28539, "name": null, "proximity": "IMMEDIATE", "rssi": -68, "txPower": -84, "uniqueId": null, "uuid": "f7826da6-4fa2-4e98-8024-bc5b71e0893e"}

is there any setup that needs to be done aside from what is listed on the documents for me to obtain the uniqueId?

johnkennethfurog avatar Jul 10 '20 03:07 johnkennethfurog

I have the same issue, react-native 0.59.10. Any ideas what's wrong?

sergeylaptev avatar Sep 09 '20 10:09 sergeylaptev

You should also scan for Secure Profile where you will get the Unique ID. I encourage you to visit the https://developer.kontakt.io/hardware/packets/secureprofile/

MKacikKontakt avatar Sep 10 '20 09:09 MKacikKontakt

Also, you will get the UniqueID when it came with Secure Response.

MKacikKontakt avatar Sep 10 '20 09:09 MKacikKontakt

Hello everyone. @MKacikKontakt was right!:) To retrieve uniqueId and other meta info (e.g. battery level, firmware revision etc) you need to add SECURE_PROFILE argument into your connect method invokation and listen for "profile*" events.

sergeylaptev avatar Sep 14 '20 09:09 sergeylaptev

Thanks for writing this here @sergeylaptev !

Do you want to add it to the documentation, perhaps as a comment in this code-block here right next to uniqueId? https://github.com/Driversnote-Dev/react-native-kontaktio/blob/master/docs/api.android.md#beacon--eddystone

andrekovac avatar Sep 14 '20 18:09 andrekovac

@kirantripathi I'm not using the package in my current projects atm so I didn't yet test it with RN 0.63 ... You don't get any errors, do you?

andrekovac avatar Nov 08 '20 17:11 andrekovac

I was trying to run minimal code but it is not returning any beacon information. @johnkennethfurog @sergeylaptev is your basic setup to scan the beacon different than the minimal code example. I try with minimal code example but got nothing as response

kirantripathi avatar Dec 22 '20 17:12 kirantripathi

Hello everyone. @MKacikKontakt was right!:) To retrieve uniqueId and other meta info (e.g. battery level, firmware revision etc) you need to add SECURE_PROFILE argument into your connect method invokation and listen for "profile*" events.

Does anyone know wow do we listen for profile events? I'm only seeing listeners for beacons and eddystone appear/update/disappear. What's the name of the listener for onProfilesUpdate? I don't see an example using SECURE_PROFILE in the docs. What am I missing? Thank ya!

@MKacikKontakt can you provide any guidance here?

kitsbits avatar Aug 05 '21 02:08 kitsbits

Hello guys, As Android 10 has introduced the new requirement of permission, please request "ACCESS_FINE_LOCATION" instead of the "ACCESS_COARSE_LOCATION" in your code. I just made this change and it works on Android 10 and 11 devices again.

don't forget to add <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> into ApplicationManifest.xml file

Ref: https://altbeacon.github.io/android-beacon-library/requesting_permission.html

hl2000 avatar Aug 19 '21 01:08 hl2000

Hello everyone. @MKacikKontakt was right!:) To retrieve uniqueId and other meta info (e.g. battery level, firmware revision etc) you need to add SECURE_PROFILE argument into your connect method invokation and listen for "profile*" events.

Does anyone know wow do we listen for profile events? I'm only seeing listeners for beacons and eddystone appear/update/disappear. What's the name of the listener for onProfilesUpdate? I don't see an example using SECURE_PROFILE in the docs. What am I missing? Thank ya!

@MKacikKontakt can you provide any guidance here?

Hi @noblepaper

I am not sure if you have fixed your issue. For Android, I am using profileDidAppear/profileDidUpdate/profileDidDisappear events to get the uniqueId,

hl2000 avatar Apr 08 '23 22:04 hl2000