diff --git a/README.md b/README.md index 7306ce49..485aa2bb 100644 --- a/README.md +++ b/README.md @@ -73,24 +73,14 @@ Contact us at [Gitter](https://gitter.im/RxBLELibraries/react-native-ble) if you ### Expo 1. Make sure your Expo project is ejected (formerly: detached). You can read how to do it [here](https://docs.expo.io/versions/latest/expokit/eject/) and [here](https://docs.expo.io/versions/latest/expokit/expokit). (only for expo) -2. Follow steps for iOS/Android. +1. Follow steps for iOS/Android. ### iOS ([example setup](https://github.com/Cierpliwy/SensorTag)) 1. `npm install --save react-native-ble-plx` -2. `npx react-native link react-native-ble-plx` -3. Open Xcode workspace located inside `ios` folder and 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. -4. Update your `ios/Podfile` to contain (it may be already there): - ``` - pod 'react-native-ble-plx', :path => '../node_modules/react-native-ble-plx' - ``` -5. Enter `ios` folder and run `pod update` -6. Add `NSBluetoothAlwaysUsageDescription` in `info.plist` file. (it is a requirement since iOS 13) -7. If you want to support background mode: +1. Enter `ios` folder and run `pod update` +1. Add `NSBluetoothAlwaysUsageDescription` in `info.plist` file. (it is a requirement since iOS 13) +1. 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. @@ -98,41 +88,41 @@ Contact us at [Gitter](https://gitter.im/RxBLELibraries/react-native-ble) if you ### Android ([example setup](https://github.com/Cierpliwy/SensorTag)) 1. `npm install --save react-native-ble-plx` -2. `npx react-native link react-native-ble-plx` -3. In top level `build.gradle` make sure that min SDK version is at least 18: -```groovy -buildscript { - ext { - ... - minSdkVersion = 18 - ... -``` -4. In `build.gradle` make sure to add jitpack repository to known repositories: - -```groovy -allprojects { - repositories { - ... - maven { url 'https://www.jitpack.io' } +1. In top level `build.gradle` make sure that min SDK version is at least 18: + + ```groovy + buildscript { + ext { + ... + minSdkVersion = 18 + ... + ``` +1. In `build.gradle` make sure to add jitpack repository to known repositories: + + ```groovy + allprojects { + repositories { + ... + maven { url 'https://www.jitpack.io' } + } } -} -``` -5. In `AndroidManifest.xml`, add Bluetooth permissions and update ``: + ``` +1. (Optional) In `AndroidManifest.xml`, add Bluetooth permissions and update ``: -```xml - - - + ```xml + + + - - + + - ... -``` + ... + ``` ## Troubleshooting