# @config-plugins/react-native-ble-plx

> Config plugin to auto configure react-native-ble-plx on prebuild

Latest version **7.0.0** (published 2023-07-14) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @config-plugins/react-native-ble-plx
pnpm add @config-plugins/react-native-ble-plx
yarn add @config-plugins/react-native-ble-plx
bun add @config-plugins/react-native-ble-plx
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2023-07-14 |
| First published | 2021-06-25 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | evanbacon |
| Keywords | react-native, expo |

## Links

- npm: https://www.npmjs.com/package/@config-plugins/react-native-ble-plx
- Repository: https://github.com/expo/config-plugins
- Homepage: https://github.com/expo/config-plugins#readme
- Issues: https://github.com/expo/config-plugins/issues
- npm.io page: https://npm.io/package/@config-plugins/react-native-ble-plx

## Recent versions

- 7.0.0 (latest) — 2023-07-14
- 6.0.0 — 2023-03-07
- 5.0.0 — 2022-12-17
- 4.0.0 — 2022-11-17
- 3.0.0 — 2022-08-08
- 2.0.1 — 2022-07-25
- 2.0.0 — 2022-05-13
- 1.0.2 — 2022-03-22
- 1.0.1 — 2022-03-16
- 1.0.0 — 2022-03-15
- 0.0.2 — 2021-11-23
- 0.0.1 — 2021-07-21
- 0.0.0 — 2021-06-25

## README

# config-plugins/react-native-ble-plx

Config plugin to auto-configure `react-native-ble-plx` when the native code is generated (`npx expo prebuild`). [Upstream PR](https://github.com/Polidea/react-native-ble-plx/pull/842).

## Expo installation

> Tested against Expo SDK 49

> This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
> First install the package with yarn, npm, or [`npx expo install`](https://docs.expo.io/workflow/expo-cli/#expo-install).

```sh
npx expo install react-native-ble-plx @config-plugins/react-native-ble-plx
```

After installing this npm package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`:

```json
{
  "expo": {
    "plugins": ["@config-plugins/react-native-ble-plx"]
  }
}
```

Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.

## API

The plugin provides props for extra customization. Every time you change the props or plugins, you'll need to rebuild (and `prebuild`) the native app. If no extra properties are added, defaults will be used.

- `isBackgroundEnabled` (_boolean_): Enable background BLE support on Android. Adds `<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>` to the `AndroidManifest.xml`. Default `false`.
- `neverForLocation` (_boolean_): Set to true only if you can strongly assert that your app never derives physical location from Bluetooth scan results. The location permission will be still required on older Android devices. Note, that some BLE beacons are filtered from the scan results. Android SDK 31+. Default `false`. _WARNING: This parameter is experimental and BLE might not work. Make sure to test before releasing to production._
- `modes` (_string[]_): Adds iOS `UIBackgroundModes` to the `Info.plist`. Options are: `peripheral`, and `central`. Defaults to undefined.
- `bluetoothAlwaysPermission` (_string | false_): Sets the iOS `NSBluetoothAlwaysUsageDescription` permission message to the `Info.plist`. Setting `false` will skip adding the permission. Defaults to `Allow $(PRODUCT_NAME) to connect to bluetooth devices`.

> Expo SDK 48 supports iOS 13+ which means `NSBluetoothPeripheralUsageDescription` is fully deprecated. It is no longer setup in `@config-plugins/react-native-ble-plx@5.0.0` and greater.

#### Example

```json
{
  "expo": {
    "plugins": [
      [
        "@config-plugins/react-native-ble-plx",
        {
          "isBackgroundEnabled": true,
          "modes": ["peripheral", "central"],
          "bluetoothAlwaysPermission": "Allow $(PRODUCT_NAME) to connect to bluetooth devices"
        }
      ]
    ]
  }
}
```

---
_Source: https://npm.io/package/@config-plugins/react-native-ble-plx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
