Hi,
I'm developing an iOS app in Swift, and the app connects to wereable devices (Smart Bracelets).
With this wereables i've to write Data object to a BLE characteristic of the device every X minutes (example: 30 minutes).
What is the best approach to do this and to work in Background?
I think there is 2 ways:
Which would be the best way to do it to ensure that the task is executed? Do a BGTask? A scheduler?
In this task is no only have to work with BLE. It must write to CBCharasteristic, read from a CBCharasteristic, and send the information to an API Server (it's important to send the data in the moment of measurement, no after when the apps move to foreground), and in some ocassions show a Local Notification (depending of the measurement)
Thank you!
I'm developing an iOS app in Swift, and the app connects to wereable devices (Smart Bracelets).
With this wereables i've to write Data object to a BLE characteristic of the device every X minutes (example: 30 minutes).
What is the best approach to do this and to work in Background?
I think there is 2 ways:
Mantain the connection always active to the device, and write to the CBCharacteristic every 30 minutes
Close the connection every "write" and reconnect every 30 minutes and write to the CBCharacteristic.
Which would be the best way to do it to ensure that the task is executed? Do a BGTask? A scheduler?
In this task is no only have to work with BLE. It must write to CBCharasteristic, read from a CBCharasteristic, and send the information to an API Server (it's important to send the data in the moment of measurement, no after when the apps move to foreground), and in some ocassions show a Local Notification (depending of the measurement)
Thank you!