UUIDs have to be specified as 128 bit UUID strings, e.g. On iOS and web it is an identifier.įilter devices by service UUIDs. ID of the device, which will be needed for further calls. (Android only) Requires adding 'neverForLocation' to AndroidManifest.xml If your app doesn't use Bluetooth scan results to derive physical location information, you can strongly assert that your app doesn't derive physical location. UUID of the characteristic (see UUID format) The ID of the device to use (obtained from requestDevice or requestLEScan) Stop listening to the changes of the value of a characteristic. StopNotifications ( deviceId: string, service: string, characteristic: string ) = > Promise - not supported, but does not throw an error.□ behind a flag in Chrome (see implementation status).❌ not supported (throws an unavailable error).Note: web support depends on the browser, see implementation status. In android/app/src/main/AndroidManifest.xml, update the permissions:.In android/app/src/main/AndroidManifest.xml, add android:exported="true" to your activity if not already added (setting android:exported is required in apps targeting Android 12 and higher).Make sure you have JDK 11+ (it is recommended to use JDK that comes with Android Studio).In android/adle, make sure compileSdkVersion and targetSdkVersion are at least 31 (changing those values can have other consequences on your app, so make sure you know what you're doing).The following steps are required to scan for Bluetooth devices without location permission on Android 12 devices: This allows the app to scan for Bluetooth devices without asking for location permissions. If your app targets Android 12 (API level 31) or higher and your app doesn't use Bluetooth scan results to derive physical location information, you can strongly assert that your app doesn't derive physical location. (Optional) Android 12 Bluetooth permissions On Android, no further steps are required to use the plugin (if you are using Capacitor 2, see here). + UIBackgroundModes + + bluetooth-central + + NSBluetoothAlwaysUsageDescription + Uses Bluetooth to connect and interact with peripheral BLE devices. See Platform Support for an overview of supported methods on Android, iOS and web. If you need the peripheral role, take a look a these plugins:įor support of Web Bluetooth in various browsers, see implementation status.īelow is an index of all the methods available. This plugin only supports the central role of the Bluetooth Low Energy protocol. Therefore the Web Bluetooth API is taken as a guidline for what features to implement. The goal is to support the same features on all platforms. This is a Capacitor plugin for Bluetooth Low Energy. Bluetooth Low Energy Maintainers Versions Introduction Installation iOS Android (Optional) Android 12 Bluetooth permissions Configuration Usage Example Applications Platform Support Legend API initialize(.) isEnabled() enable() disable() startEnabledNotifications(.) stopEnabledNotifications() isLocationEnabled() openLocationSettings() openBluetoothSettings() openAppSettings() setDisplayStrings(.) requestDevice(.) requestLEScan(.) stopLEScan() getDevices(.) getConnectedDevices(.) connect(.) createBond(.) isBonded(.) disconnect(.) getServices(.) discoverServices(.) getMtu(.) requestConnectionPriority(.) readRssi(.) read(.) write(.) writeWithoutResponse(.) readDescriptor(.) writeDescriptor(.) startNotifications(.) stopNotifications(.) Interfaces InitializeOptions DisplayStrings BleDevice RequestBleDeviceOptions ScanResult DataView ArrayBuffer TimeoutOptions BleService BleCharacteristic BleCharacteristicProperties BleDescriptor Enums ScanMode ConnectionPriority UUID format Troubleshooting Connection fails on Android Contributors ✨ README.mdīluetooth Low plugin for Bluetooth Low Energy
0 Comments
Leave a Reply. |