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:

Building a Full-Featured Laravel Admin Dashboard with Filament

Building a full-featured Laravel admin dashboard with Filament

Build scalable admin dashboards with Filament and Laravel using Form Builder, Notifications, and Actions for clean, interactive panels.

Kayode Adeniyi
Dec 20, 2024 â‹… 5 min read
Working With URLs In JavaScript

Working with URLs in JavaScript

Break down the parts of a URL and explore APIs for working with them in JavaScript, parsing them, building query strings, checking their validity, etc.

Joe Attardi
Dec 19, 2024 â‹… 6 min read
Lazy Loading Vs. Eager Loading

Lazy loading vs. Eager loading

In this guide, explore lazy loading and error loading as two techniques for fetching data in React apps.

Njong Emy
Dec 18, 2024 â‹… 5 min read
Deno logo over an orange background

How to migrate your Node.js app to Deno 2.0

Deno is a popular JavaScript runtime, and it recently launched version 2.0 with several new features, bug fixes, and improvements […]

Yashodhan Joshi
Dec 17, 2024 â‹… 7 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