iOS vs Android
Both iOS and Android handle BLE differently If you are developing a Bluetooth app that needs to support both iOS and Android - you may want to be aware of how they differ when it comes to BLE.
Both iOS and Android handle BLE differently
If you are developing a Bluetooth app that needs to support both iOS and Android - you may want to be aware of how they differ when it comes to BLE.
This is especially helpful if you are creating a cross-platform plugin for Flutter, React Native, etc.
Here are 5 of the most important:
- CoreBluetooth APIs can be called in parallel. Android Bluetooth APIs need to be called in serial. This is the biggie - invoking an Android Bluetooth function before the previous one returns will likely lead to instability.
- CoreBluetooth will limit the connection interval to 15ms. Android Bluetooth will let you set it as low as 7.5ms.
- CoreBluetooth has a maximum transmission unit (MTU) of 251 bytes (with Data Length Extensions enabled on the peripheral). Android Bluetooth will max out at 512 bytes.
- CoreBluetooth has a very low supervisor timeout. Android Bluetooth is hardcoded at 5s. This means that disconnecting will potentially take longer than expected on Android.
- When scanning for devices in the background, iOS does not request the Scan Response, meaning any and all necessary info must be in the Advertisement packet (like service class, name, manufacturer data).
While there are more, these 5 are important to keep in mind while designing the user experience (aka integration) with the device.