Automatic call connectWithHandler when Metaware in Range

Is there a way for iOS app in background or suspend mode to automatic call connectWithHandler when metawear in range?

Will having it always connected when in range drain significant battery of metawear?

Comments

  • To use MetaWear in the background you first need to enable background mode "Uses Bluetooth LE Accessories" as show here:
     
    image

    Then you can just call connectWithHandler: and the callback with complete whenever the specified MetaWear is in range.  The call to connectWithHandler: will never "time out" so iOS will continually look for the device, even if the app is in the background.

    Being in a connection does require more power from both the phone and MetaWear, but I don't have any quantitative data and it will vary by use case.  The most accurate way would be to run some experiments using your exact code.
  • Awesome. 

    Is there a delegate method I can implement say that the phone will automatically download the log when metawear when in range?
  • Did some research and I need a call back from didDisconnectPeripheral in order to call the connectWithHandler again. 
This discussion has been closed.