don/cordova-plugin-ble-central

writeDescriptor was deprecated in API level 33

Opened this issue · 0 comments

The method writeDescriptor is deprecated. (click on the link) The new method returns int instead of boolean. Maybe we need to wrap this into a API check. I don't know what the byte[] value is. Both method descriptions refer to value, but the deprecated one has no value. Does anyone have experience with it?

Example usage:

if (!gatt.writeDescriptor(descriptor)) {
callbackContext.error("Failed to set client characteristic notification for " + characteristicUUID);
notificationCallbacks.remove(key);
commandCompleted();
}

if (descriptor != null) {
descriptor.setValue(BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE);
gatt.writeDescriptor(descriptor);
}