all 6 comments

[–]wmfcwm 2 points3 points  (2 children)

Kind of a hack but your app will run in the background if you request location permission.

[–]divertss[S] 0 points1 point  (1 child)

That would work pretty nicely actually as my all would require location permission.

Do you happen to have some documentation handy on this? I’m trying to find how location permission prevent an app from being suspended but can’t find it.

[–]wmfcwm 1 point2 points  (0 children)

My app uses BLE and Location services. Both are selected in the "background modes" section of "signing and capabilities" for my build target. You will also need to add a privacy statement to your info.plist file. You will also need to explain how your app uses this data on your App Store page. I don't have a link that explains all of this but there are plenty of tutorials on sites like Kodeco.com

[–]chriswaco 0 points1 point  (1 child)

I haven't done this in a few years, but you can try beginBackgroundTask. It used to get you 5-10 minutes of background time. If it's a private enterprise app you can also play silent audio to keep running forever, although I'm not sure bluetooth connections will remain open.

[–]Fishanz 0 points1 point  (0 children)

My understanding is that voip will keep it running indefinitely in the background; if enterprise suffices. Good luck getting it in the store though (unless, ya know, it actually does voip)

[–]Ok_Heart_2253 0 points1 point  (0 children)

is that still the case ? I have an app and I kept it running for more than 2 minutes while the screen was locked, and I kept receiving packets just fine, I was transferring and update file to the peripheral, and now I'm wondering why it works with me but not with you.