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 crash on startup #3

Closed vanlooverenkoen closed 4 years ago

vanlooverenkoen commented 4 years ago

I copied the example dart code to my project and the app crashes on startup.

vanlooverenkoen commented 4 years ago

I forgot to add the background capability & added

OUTDATED

    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>The app uses bluetooth to find, connect and transfer data between different devices</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>The app uses bluetooth to find, connect and transfer data between different devices</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>bluetooth-central</string>
    </array>

image

correct answer (2 comments down) -> https://github.com/BeMacized/xiaomi_scale/issues/3#issuecomment-662662144

vanlooverenkoen commented 4 years ago

5 documentation should be added

vanlooverenkoen commented 4 years ago

After doing some research today (resolved in a pr #6 ). I found ot that the UIBackgroudModes are not needed. The 2 descriptions are.

This is what you should add to your info.plist (customize your text for your needs)

    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>The app uses bluetooth to find, connect and transfer data between different devices</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>The app uses bluetooth to find, connect and transfer data between different devices</string>