Friday, May 22, 2020

Swift iPhone: Bluetooth communication in the sleep state

A self-made  watch app I've posted in the past found that it doesn't work when the instruction-mediating iPhone is in a sleep state.

It's possible to always run the iPhone app on the front side when the camera is connected via Bluetooth, but that comes at the cost of battery consumption.

Then, I found a way to send recording command by bluetooth to the camera even if the iPhone app is in sleep mode.

Select Signing & Capabilities and press "+Capability" on the left. Next,Select Background Modes from the list that appears.
Choose Use Bluetooth LE accessories and Acts as a Bluetooth LE accessory from the added Modes.
After selecting the above option, run the build. So even if you put your iPhone in sleep mode after connecting to the camera, you can still record remotely from your apple watch. 

Reference information 

No comments:

Post a Comment