Running the application in the background

Hello! I have an beacon (this. device doesn't support pair) that should work as SOS button, but required option is that the device should work for a long time in background. Sequence algorithm:

  1. BLE device send trigger to nearest device
  2. iPhone should receive this trigger (in background) then do network request

I can't find right solution cz the BGTask has 30 sec limit

Answered by Engineer in 685199022

You don't need the app to be running in the background to accomplish something like what you are describing. A properly architected app using CoreBluetooth along with a properly configured accessory should be able to wake up in response to events from the accessory as necessary.

This document should help explain your options: https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html

Accepted Answer

You don't need the app to be running in the background to accomplish something like what you are describing. A properly architected app using CoreBluetooth along with a properly configured accessory should be able to wake up in response to events from the accessory as necessary.

This document should help explain your options: https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html

Running the application in the background
 
 
Q