Bluetooth background with iOS device

I am working on creating a bluetooth peripheral device to work with my iOS device. I need to get the iOS application to receive data in the background and process this data as it arrives. Looking through the core of Apple CoreBluetooth, I see how you can use background modes. Now, to save energy, I want the iOS device to connect only to a Bluetooth peripheral device at a certain time (without the need for user interaction). I looked at local notifications in iOS and has very limited functionality and don't think it provides what I need.

Anyway, to wake up the application at 18:00 and ask the application to start scanning for Bluetooth devices? And then execute another code after connecting the device? All this without user interaction.

Any suggestions would be appreciated!

Thank!

+4
source share
1 answer

You cannot schedule operations at specific times in iOS (except for a local notification, which, as you said, does not match what you need).

You can use the background fetch mode to periodically let your application check for new data. You can set the interval (although this is only a guideline for iOS, not a strict schedule) how often your application wakes up.

iOS performFetchWithCompletionHandler, , . , UIBackgroundFetchResultNoData. , , UIBackgroundFetchResultNewData

+2

All Articles