MichelleJS
MichelleJS

Reputation: 759

How to set bluetooth communication to run in background

I am working on a medical related app where a medical device interfaces via bluetooth with an iphone. However I cannot figure out how to allow the app to run indefinately in the background. Right now it only communicates when the app is open. I have been reading a lot of questions related to this and I haven't managed to find an answer which fits. I'm sorry if this is a duplicate. Can someone point me in the direction of how to implement this.

ETA - I just got confirmation that this is supposed to be able to go on the App Store.

Upvotes: 1

Views: 3055

Answers (1)

Lewis Gordon
Lewis Gordon

Reputation: 1741

Did you come across this question: Background time issue for Bluetooth LE app for Iphone 4s

It seems that adding the background mode bluetooth-central (see documentation) can enable your app to run in the background while handling bluetooth events. As noted in the question above though, you could always set background mode to audio and play a blank looping audio track to keep your app alive and responding if you don't need to be on the App Store.

Upvotes: 3

Related Questions