Closed cbreezier closed 3 years ago
It should work the same way. https://github.com/Polidea/MultiPlatformBleAdapter/blob/master/iOS/classes/BleModule.swift#L400
Same issue with version 2.2.6
i have the same issue
@cbreezier @dokinkon
As a workaround you can use Dart's timeout method:
await device.connect().timeout(Duration(seconds: 3));
If you have some issues with scanning or connecting to the device once it's available/in range again, also add this hack:
try {
await device.disconnectOrCancelConnection();
} catch (e) {}
@mikolak Any upates?
No news, sorry. I'll try to fix it this month.
Almost a half year later, but the issue will be fixed in the nearest release, probably by the end of the week.
device
is aPeripheral
object. This dart code works fine on Android, where a connection attempt is cancelled after 3 seconds and an exception is thrown (and caught).However, the same code doesn't seem to do anything on iOS. The connection attempt seems to last forever.
Is the
timeout
parameter supported on iOS?