Ionic Native BLE Instantly Disconnects or Refuses to Connect

I’m attempting to use the Ionic Native BLE plugin with cordova to connect to a device however on android devices it will connect momentarily before instantly disconnecting and iOS devices the BLE refused to connect at all to the device. The version of @ionic-native/ble is 5.34.0.

Note that ionic-native is deprecated. You should use @awesome-cordova-plugins/ble instead. Also make sure you’re using an up-to-date version of the actual plugin cordova-plugin-ble-central (@awesome-cordova-plugins/ble is just a wrapper for the cordova plugin).

Then make sure you’re following the installation documentation of the cordova plugin. For Bluetooth to work in you app, you need to setup the permissions correctly.

I would also suggest to check the Android Studio / XCode logs for any errors regarding Bluetooth or app permissions.

Alternatively, if you’re using Capacitor, there is also a Capacitor Community plugin for Bluetooth Low Energy (I’m the author of that plugin).

1 Like