jicang / healywatch_reactive

ff
0 stars 3 forks source link

On iOS, the watch cannot be connected if it is previously paired to the phone #72

Closed BradKwon closed 2 years ago

BradKwon commented 2 years ago

If I do it like below steps, the watch is not scannable anymore so cannot connect the watch. The below steps are done on HW2 because your iOS example app crashes when I connect the watch with this error

reactive_ble_mobile[/PluginController.swift:163](): Assertion failed

  • thread 1, queue = 'com.apple.main-thread', stop reason = Assertion failed frame #0: 0x0000000186bdcd7c libswiftCore.dylib_swift_runtime_on_report libswiftCore.dylib_swift_runtime_on_report: -> 0x186bdcd7c <+0>: ret libswiftCore.dylib_swift_reportToDebugger: 0x186bdcd80 <+0>: b 0x186bdcd7c ; _swift_runtime_on_report libswiftCore.dylib_swift_shouldReportFatalErrorsToDebugger: 0x186bdcd84 <+0>: adrp x8, 335437 0x186bdcd88 <+4>: ldrb w0, [x8, #0x2f4] Target 0: (Runner) stopped. Lost connection to device. Exited (sigterm)

Steps: 1) Run iOS app with this watch Sdk (so, HW2) 2) Click "OK" on Bluetooth permission native dialog 3) Click "OK" on find and connect to devices on your local network permission native dialog 4) Connect watch in the app 5) Click "OK" on native pairing dialog 6) Click "OK" on native notification access permission dialog 7) Watch connection status it connected in the app and it works fine. 8) Kill and open the app (so, cold start) 9) Watch is not automatically re-connected although the watch displayed it is paired (green dash icon at the top-left side of watch device screen) 10) Your watch Sdk tries to re-connect the previously connected device by toConnectExistId() in bluetooth_connection_util.dart. But the watch already paired is not scannable so no scanned device sent. 11) I confirmed that it works when I don't pair the watch to the phone by clicking "Cancel" on native pairing dialog

Additionally, this does not happen in HW1