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

Cannot scan Eddystone service UUID on Android with versions > 2.0.3 #1155

Open
2 tasks done
pwellner opened this issue Dec 14, 2023 · 10 comments
Open
2 tasks done

Cannot scan Eddystone service UUID on Android with versions > 2.0.3 #1155

pwellner opened this issue Dec 14, 2023 · 10 comments
Labels

Comments

@pwellner
Copy link

pwellner commented Dec 14, 2023

Prerequisites

  • I checked the documentation and FAQ without finding a solution
  • I checked to make sure that this issue has not already been filed

Expected Behavior

startDeviceScan(["0000feaa-0000-1000-8000-00805f9b34fb"], ...) should find BLE devices advertising with this standard Eddystone UUID when running on iOS and on Android

Current Behavior

When using v3.1.2 devices with this UUID are NOT found on Android, but are found correctly on iOS.
When using v2.0.3 devices with this UUID are found correctly on Android AND on iOS

Library version

3.1.2

Device

Android 12 OnePlus Nord N20 5G CPH2459

Environment info

react-native `0.72.6` and expo `^49.0.21`

Steps to reproduce

Connect Android device to development system with Android studio installed, and have an Eddystone beacon available nearby.

$ git clone git@github.com:pwellner/ble-plx-scan-bug.git
$ yarn
$ npx expo prebuild
$ npx expo run:android --device

Run test program on device. Press the "GET PERMISSIONS" button, accept all permissions, then press the "SCAN SELECTED" button, and observe the log files.

Devices with Eddystone UUID "0000feaa-0000-1000-8000-00805f9b34fb" are not logged.

$ git checkout HEAD~1   # (only change is to revert package to v2.0.3)
$ yarn
$ npx expo prebuild
$ npx expo run:android --device

Run test program again and observe the logs. Devices with Eddystone UUID "0000feaa-0000-1000-8000-00805f9b34fb" are all found correctly.

Formatted code sample or link to a repository

https://github.com/pwellner/ble-plx-scan-bug

Relevant log output

Devices with UUID 0000feaa-0000-1000-8000-00805f9b34fb appear correctly on iOS and on Android when using v2.0.3, but they do not appear when using v3.1.2 on Android

Additional information

No response

@pwellner
Copy link
Author

Contact me if you need a beacon to test this.

@pwellner
Copy link
Author

Note: This problem persists with or without legacyScan: false

Could this issue be related to dotintent/MultiPlatformBleAdapter#102 ?

@dominik-czupryna-withintent
Copy link
Collaborator

The bug has been confirmed and we are working on it.

@EmmaZachara
Copy link
Collaborator

Hi @pwellner,
We have worked on the RN side of the issue, but we will also have to engage the Android team. This is planned for next week, so we will get back to you with an update as soon as possible.
I appreciate your patience!

@pwellner
Copy link
Author

pwellner commented Mar 1, 2024

Good news, Thanks. Let me know if there's anything I can do to help.

@pwellner
Copy link
Author

@EmmaZachara, Any update? I noticed this issue appears even with v2.0.3 after upgrading to expo 50.0.11 and react-native 0.73.4.

I'll be glad to upgrade the example ble-plx-scan-bug repository if that that helps.

@pwellner
Copy link
Author

More info:
With expo 50.0.11 and react-native 0.73.4 on Android, the old react-native-ble-plx 2.0.3 startDeviceScan() is able to scan Eddystone beacons with uuid = null, but the new react-native-ble-plx 3.1.2 is never able to find them, even with uuid = null

@EmmaZachara
Copy link
Collaborator

Hi @pwellner
Thank you for the additional info. Our Android dev will get back to working on that tomorrow. He will write his status and further approach.

@pwellner
Copy link
Author

pwellner commented May 3, 2024

@dominik-czupryna-withintent, would you consider accepting a PR to fix this bug? I would like to fix this if you or your colleagues are open to it. To get me started, could you point me to the Android dependency repository that you think will need attention?

@dominik-czupryna-withintent
Copy link
Collaborator

dominik-czupryna-withintent commented May 5, 2024

Hi @pwellner,
of course, feel free to open new PR, we merge smaller PRs with each release. For more complex PRs we make a release for them. Unfortunately, I wasn't able to solve this issue, and our BLE Android developer is focused on another project (at the moment the task is still in progress and unfortunately, I am not able to tell a date when it will be ready). On branch https://github.com/dotintent/react-native-ble-plx/tree/bugfix/Issue-1155 you will find your code moved to the example app (react-native-ble-plx/example/), which uses directly the code from the main directory and allows you to build the app with the changes made. Under the hood for Android, we use https://github.com/dariuszseweryn/RxAndroidBle, and our iOS is based on https://github.com/Polidea/RxBluetoothKit.

If you have any additional questions, feel free to ask, I will help if I can.

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

No branches or pull requests

3 participants