Closed hl2000 closed 1 year ago
ok, finally, I found the reason and the solution.
For Android, Kontakt uses different methods for new and old chips.
For beacons made with nrf 51 the old chip, the beacon event listener(e.g. beaconDidAppear) is still working and able to get the uniqueId and battery level, but for beacons made with new nrf 52 chip, you will have to listen to the profile related events(e.g. profileDidAppear) to get the uniqueId and battery level.
For iOS, you can still use the discovery events(e.g. didDiscoverDevices) to get the uniqueId and battery level for both old and new chips.
This null uniqueId issue has been mentioned before: https://github.com/Driversnote-Dev/react-native-kontaktio/issues/76 When I have old beacons with old chips(ordered in 2019), the beaconDidAppearcan already gives me the uniqueId.
Later I got the new Kontakt beacons, beaconDidAppearcan return empty(null) uniqueId, then I found this https://github.com/kontaktio/kontakt-android-sdk/issues/193 I realised the uniqueId issue mentioned above is actually related to "new beacons", so have to use the profile related event to get.
If anyone else has similar issues, happy to discuss.
Hi guys,
I am experiencing a strange issue with an Android device. the device is Samsung Galaxy A52s 5G running Android 13 and Samsung s21 running Android 13. Beacon is a Kontakt beacon.
The beacon has been detected, but the value for uniqueID and Battery are null, please see the screenshot below. the major, minor, uuid are all correctly detected.
I created a simple app to verify this issue, I followed the readme file. Start a new React Native TypeScript project (npx react-native init BeaconTest --template react-native-template-typescript)
then I replace the content of App.tsx with the Android example code below. https://github.com/Driversnote-Dev/react-native-kontaktio/blob/master/Example/src/Example.android.tsx
I have also added permission checks for ACCESS_FINE_LOCATION, BLUETOOTH_SCAN, BLUETOOTH_CONNECT
Here is the permission section of my manifest file. (I am trying to find the issue seems particularly for Android 13, not 100% sure if other Android versions also have this issue)
part of the android\build.gradle
I added a line to display the detected beacon objects on the screen: stringify: {JSON.stringify(beacon)}
from the screenshot, you can see the value for uniqueID and Battery are null.
What do you think guys? What could be wrong? Any permission not granted to allow the library to acquire the Kontakt exclusive values? or the Kontakt library needs an update? in this file android/app/build.gradle I tried to change the implementation "io.kontakt.mvn:sdk:7.0.6" to be implementation "io.kontakt.mvn:sdk:7.0.12.2", seems no different.
Has anyone seen a similar issue before, please help! or please point me to a possible direction to dig more...
Thanks!