npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-ble-plx-ccc

v0.0.1

Published

Fork of React Native Bluetooth Low Energy library (cccd + getBondedDevices)

Downloads

38

Readme

This is a fork of react-native-ble-plx to fix two issues on Android:

Changes included in this fork

  • Bring back cccDescriptor enableValue from 0.8.0 (BleModule::safeMonitorCharacteristicForDevice)
  • getBondedDevices
    • Android: returns list of bonded devices (rxBleClient.getBondedDevices())
    • iOS: returns empty list

Original Readme

About this library

This is React Native Bluetooth Low Energy library using RxBluetoothKit and RxAndroidBle under the hood.

It supports:

What this library does NOT support:

  • turning the device's Bluetooth adapter on
  • communicating between phones using BLE (Peripheral support)
  • bonding peripherals

Recent Changes

0.10.0

Breaking changes:

  • Deprecate old build system. Carthage is not required anymore. To fix your current project please do following steps:

    1. Add empty Swift file if you don't have at least one:
      • Select File/New/File...
      • Choose Swift file and click Next.
      • Name it however you want, select your targets and create it.
      • Accept to create Objective-C bridging header.
    2. Remove copy-frameworks script if you don't have any other dependency requiring it:
      • Go to Your Target / Build Phases
      • Remove run script.

Other:

  • Fix warning when no listeners were attached and events were emitted.
  • Show error.message properly. Make sure that invalid errorCodes from implementation side won't trigger another error during construction.
  • Property ServiceUUID is properly propagated to IncludedServicesDiscoveryFailed's error message.
  • Add missing deviceServicesNotDiscovered implementation on Android.

All previous changes

Documentation & Support

Interested in React Native project involving Bluetooth Low Energy? We can help you!

Documentation can be found here.

Contact us at Gitter if you have any questions, feedback or want to help!

Configuration & Installation

iOS (pure react-native)

  1. npm install --save react-native-ble-plx
  2. react-native link react-native-ble-plx
  3. Add empty Swift file if you don't have at least one:
    • Select File/New/File...
    • Choose Swift file and click Next.
    • Name it however you want, select your targets and create it.
    • Accept to create Objective-C bridging header.
  4. Minimal supported version of iOS is 8.0
  5. If you want to support background mode:
    • In your application target go to Capabilities tab and enable Uses Bluetooth LE Accessories in Background Modes section.
    • Pass restoreStateIdentifier and restoreStateFunction to BleManager constructor.

iOS (expo/Podfile)

  1. Make sure your Expo project is detached. You can read how to do it here and here.
  2. npm install --save react-native-ble-plx
  3. react-native link react-native-ble-plx
  4. Add empty Swift file if you don't have at least one:
    • Select File/New/File...
    • Choose Swift file and click Next.
    • Name it however you want, select your application target and create it.
    • Accept to create Objective-C bridging header.
  5. Update your ios/Podfile to contain:
    pod 'react-native-ble-plx', :path => '../node_modules/react-native-ble-plx'
    pod 'react-native-ble-plx-swift', :path => '../node_modules/react-native-ble-plx'
  6. Enter ios folder and run pod update
  7. Minimal supported version of iOS is 8.0
  8. If you want to support background mode:
    • In your application target go to Capabilities tab and enable Uses Bluetooth LE Accessories in Background Modes section.
    • Pass restoreStateIdentifier and restoreStateFunction to BleManager constructor.

Android

  1. npm install --save react-native-ble-plx
  2. react-native link react-native-ble-plx
  3. In build.gradle of app module make sure that min SDK version is at least 18:
android {
    ...
    defaultConfig {
        minSdkVersion 18
        ...
  1. In AndroidManifest.xml, add Bluetooth permissions and update <uses-sdk/>:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    ...
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    <!-- Add this line if your application always requires BLE. More info can be found on:
         https://developer.android.com/guide/topics/connectivity/bluetooth-le.html#permissions
      -->
    <uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>

    <uses-sdk
        android:minSdkVersion="18"
        ...

Troubleshooting

Problems with Proguard

Add this to your app/proguard-rules.pro

-dontwarn com.polidea.reactnativeble.**