1
votes

I am trying to find a clever way to keep a BLE app active in the background on iOS 6, without breaking any of Apple's rules. I plan to use the phone as a peripheral device and another BLE circuit as the central. My app will automatically be opened when a user arrives to a building using geofencing. After that the iPhone will connect to the first BLE central device it sees (the device will be in its white list). The user will then be able to move throughout the building switching to different BLE "nodes".

My question is: What do I need to do in the background when a user is stationary at their desk so that the app does not get suspended due to memory resources?

My idea is based on this solution for a separate problem: There could potentially (not regularly) be 10-50 users in an area with only a few BLE "nodes" and I read at bluetooth.org that I could setup a dynamic connection system, basically rotating connections through all the users.

My idea is to setup a similar dynamic system where the central device (not the iPhone) disconnects the device on regular intervals (30-40 minutes) and then the iPhone will reconnect.

Is this something that some feasible? Is this against the iOS development guidelines? I was unable to find anything explicit about this. I have also asked on the iOS developer forum, but unfortunately it is not as popular as this site.

Thanks in advance!

1
Since we don't really know what is in the mind of Apple, your best bet may be to talk to them or consult their guidelines. I'm guessing if they really don't want you to do this, there's probably no technical workaround.Robert Harvey
Thanks for the response. Like I mentioned I have contacted them, but they are not very responsive on their forums. I do not want to design an app and then have it denied. Also, I am not even sure if this sounds like something that's feasible. I was hoping someone would have experience developing BLE on iOS.user1743668
"My question is: What do I need to do in the background when a user is stationary at their desk so that the app does not get suspended due to memory resources?" If the phone is out of resource, then any other app could be out of luck too. But if there exist such a way that an app would get preferential treatment when there are no resource, then why wouldn't every app developer do the same thing? But then, what's the point of resource management if every app can defeat it?yuklai
I do not understand why people like you reply to these questions and forums with responses that help no one. My only guess is to make yourself feel more intelligent. But you are missing the point. This is a BLE specific question. My proposed solution involve BLE. So I am not looking for a solution that every app can use. I am trying to find a solution to use BLE much like traditional bluetooth is used but without the power consumption (which seems like the reason bLE was developed). Please leave your condescending remarks to yourself!user1743668
I think you misunderstood my intention. I was just thinking out loud. But I can see how that can be misunderstood. The same question still applies to apps that uses BLE. If an app can use BLE to defeat memory management, then all apps can use BLE to do the same. That's just my thinking.yuklai

1 Answers

1
votes

Xcode -> Project target -> Capabilities -> Enable background mode

Check Uses Bluetooth LE Accessories

Capabilities

Also enable the following key in .plist file

Required background modes

App communicates using CoreBluetooth

Plist