BeMacized / xiaomi_scale

A Flutter plugin for taking measurements from Bluetooth Xiaomi weight scales
https://pub.dev/packages/xiaomi_scale/
MIT License
18 stars 9 forks source link

iOS app crashes when start tracking / start scanning #4

Closed vanlooverenkoen closed 4 years ago

vanlooverenkoen commented 4 years ago

on iOS the app crashes when start scanning, start trracking

On android this works perfectly.

I copied the example in my project, added the permissions on iOS. And got the flutterr screens with tabs visible. From the moment i click start taking measurements or start scanning the app crashes.

I am an android developer so I have no idea how I can debug this.

vanlooverenkoen commented 4 years ago

I just ran the flutter_reactive_ble example in my project and that works perfectly. So there is something else wrong.

the flutter_reactive_ble version that you are using is outdated as well. But I used override_dependencies and still got the same error

BeMacized commented 4 years ago

Hmm, I have to admit that I haven't tested this on iOS as I don't know much about iOS development, nor do I own an iOS device to test. I had kind of expected it to just work as I don't have any native code in the plugin itself. The only native interaction comes from the flutter_reactive_ble dependency. Upgrading it seems like a good place to start though.

I do have an iOS device to test on in the office, but I'm not sure when I'll be in next due to corona and all. Any help on this would be very much appreciated

vanlooverenkoen commented 4 years ago

Indeed I was thinking the same. I will do some extra debugging this evening

vanlooverenkoen commented 4 years ago

Fixed in #6 -> Location permission was requested. But that is only needed for iOS. flutter_reactive_ble already handles the permissions for iOS. So I have just added a if (Plaftorm.isAndroid) check in the checkPermissions method.