More Premium Hugo Themes Premium React Themes

React Native Bluetooth Classic

Bluetooth classic Android(Bluetooth)/IOS(ExternalAccessory) module for serial communication

React Native Bluetooth Classic

Bluetooth classic Android(Bluetooth)/IOS(ExternalAccessory) module for serial communication

Author Avatar Theme by kenjdavidson
Github Stars Github Stars: 257
Last Commit Last Commit: Feb 4, 2025 -
First Commit Created: Feb 24, 2024 -
default image

Overview:

React Native Bluetooth Classic is a library designed to facilitate the use of Bluetooth Classic on iOS devices by utilizing the External Accessory framework. It is an extension of the react-native-bluetooth-serial port, with improvements and updates targeted specifically at replacing CoreBluetooth (BLE) on iOS. The library offers different versions tailored to specific React Native versions, with considerations for potential breaking changes.

Features:

  • Bridge for iOS Bluetooth Classic: Connects React Native applications to Bluetooth Classic on iOS through the External Accessory framework.
  • Compatibility: Versions available for different ranges of React Native versions, ensuring compatibility with various app setups.
  • Auto Linking: Supports autolinking for React Native 0.60.0 and above, simplifying the installation process.
  • Manual Installation: Provides steps for manual installation, helpful for contributions or troubleshooting autolinking issues.
  • Android Autolinking: Automatic configuration for autolinking on Android post React Native 0.60.0 update.
  • Adjustable Linking: Ability to override default autolinking configuration to customize implementations on Android.

Installation:

Getting started:
Install the library from NPM for React Native 0.60.0 and later versions, which support autolinking.

Manual Installation (iOS):

  1. In Xcode, navigate to project navigator, right-click Libraries ➜ Add Files to [your project’s name].
  2. Find node_modules ➜ react-native-bluetooth-classic, then add RNBluetoothClassic.xcodeproj.
  3. In Xcode, select your project from the navigator, and add libRNBluetoothClassic.a to Build Phases ➜ Link Binary With Libraries.
  4. Run your project using Cmd+R.

iOS Pods:
Update the Podfile with the appropriate line to include the development pod for iOS.

Android Autolinking:
With React Native 0.60.0 and later, autolinking is supported; default configuration is provided. For custom implementations, autolinking can be overridden following the documentation.

Disable Autolinking (Android):
To skip autolinking, disable it by:

  1. Opening react-native.config.js to disable autolinking.
  2. In MainApplication.java, located at android/app/src/main/java/[…]/, import kjd.reactnative.bluetooth.RNBluetoothClassicPackage at the top.
  3. Add a new RNBlue…

Summary:

The React Native Bluetooth Classic library is a useful tool for integrating Bluetooth Classic functionalities into React Native applications, especially on iOS devices where the External Accessory framework is utilized. The library’s versions cater to different React Native versions, ensuring compatibility and ease of use. Installation is streamlined with autolinking support for newer versions of React Native, and manual installation steps are provided for exceptional cases. Autolinking on Android is supported out-of-the-box, with flexibility to override configurations for custom implementations, making it a versatile solution for developers needing Bluetooth Classic capabilities in their React Native projects.