2

I'm helping a friend with an iOS app and we have run into a bit of a snag. Basically, the app needs to be able to send and receive BLE data while the app is backgrounded and the phone is locked. This interaction needs to be pretty rapid (<500ms or so). The actual connecting and disconnecting of the BLE accessory will be handled within the app while foregrounded, but the send/receive needs to occur while the app is backgrounded and phone locked.

This essentially amounts to streaming data back and forth between the BLE accessory and the phone while the phone does some processing.

The basic user journey:

  1. User opens app and connects to BLE accessory in-app
  2. User backgrounds the app and locks the phone
  3. BLE accessory mic picks up audio and sends audio data to phone
  4. Phone receives and processes data while locked
  5. Phone sends data back to BLE accessory

We have it fully working while the app is foregrounded. Is this possible to do while backgrounded/locked? If so, are there any resources you could point me to?

Thanks in advance :)

iamthearm
  • 513
  • 2
  • 15

1 Answers1

1

Yes this should be doable in the background, but you need to add code to support this feature as it is not enabled by default. Have a look at the link below, specifically the section "Adding Support for State Preservation and Restoration":-

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72