2023-08-08
3747
#react native
Chimezie Innocent
164061
109
Aug 8, 2023 â‹… 13 min read

Using react-native-ble-manager in a mobile application

Chimezie Innocent I am Chimezie, a software developer based in Nigeria. I am highly skilled in HTML, CSS, and JS to build web-accessible and progressive apps. I'm also skilled with React for web, React Native for Android apps, and Tailwind CSS. I write technical articles, too.

Recent posts:

Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 min read
JavaScript logo on top of violet background

Exploring essential DOM methods for frontend development

Learn four groups of DOM methods and their uses to create responsive and dynamic webpages. A helpful DOM reference table is also included.

Chimezie Innocent
Jul 23, 2024 â‹… 12 min read
View all posts

19 Replies to "Using <code>react-native-ble-manager</code> in a mobile application"

  1. I get the error:

    null is not an object (evaluating ‘bleManager.scan’)

    when I tap on “Scan Bluetooth Devices” button.

    I’m running it in Expo Go in an Android simulator. Is it supposed to be run in Expo Go, either in a simulator or real device?

    1. Hey Alan,

      The issue is with Expo. Expo does not support the ble-manager package. You need to use a native project for it

  2. When I press scan bluetooth devices, and it said, need android.permission.BLUETOOTH_SCAN permission for AttributionSource {uid= 10162, packageName = com.yourprojectname, attributionTag= null, token = android.os.BinderProxy@df42937, next= null}: GattServiceregisterScanner

      1. Yeah, I have answered the question.

        Also, the article has been updated(will be published shortly after review) and should address any more of your questions. Thank you.

    1. This error message means you don’t have android.permission.BLUETOOTH_SCAN permission that is required to scan for devices.

      To resolve this issue, check if the permission is included in your AndroidManifest.xml file. By permission, I’m referring to the last line in the code below but make sure the others are included too:

  3. using react native cli,getting .BLUETOOTH_SCAN permission error on android 12 ad for android 10, 11 no any bluetooth device found

    1. Android 12 requires extra permissions like the ACCESS_FINE_LOCATION. Add this line to your AndroidManifest.xml file.

      Follow the rest of the article and it should resolved

  4. I am on android 13. I click the scan button and nothing returns. I know there are ble devices by using nRF Connect. Any idea why no devices would display after scanning?

        1. Has the article been published yet? I am having issues with android 13 not looking like its scanning for devices. I am also having issues with android 12 (Yes, I added all bluetooth related uses permissions to the manifest file), where it returns a android.permissions.bluetooth_scan exception.

  5. With the introduction of Android 13, they have added yet another layer of permission you must get first before any of your Bluetooth permissions will work. you must add the NEARBY_WIFI_DEVICES as well now.

  6. I have another concern. I need to listen for notifications from the BLE device all the time and show an alert in the UI

  7. Was having issues with this. Want to note that “ACCESS_FINE_LOCATION” permission is checked twice. If you change one of these to:

    PermissionsAndroid.check(
    PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
    )

    It seems to work

Leave a Reply