0

I have an app, which runs on a background. It would be great if the app would run on some inaccessible threat and user couldn't turn it off just by classic "double home button style". Is that possible on iOS? How all those notification apps like news work, that Im still getting notifications even if they are not listed in "double home button menu"?

My app is checking if there are new data in HealthKit. It works on the background, but user can easily turn it off and thats kind of stupid in this case... I use This to get data from HK while in the background (the code of the guy who posted that question), is that right way?

Also why my app don't ask for permission to run in background? Why it isn't listed in general settings-BackgroundAppRefresh?

Thank you for any answers/tipes

Community
  • 1
  • 1
Lolipop52
  • 25
  • 8

2 Answers2

0

No, you can't do that. Apple does not allow iOS Daemons (faceless background apps.) Simply having a user-visible app that runs continuously in the background is nearly impossible, and not allowed by Apple's guidelines. The closest you can come is to create an app that is set up to play music from the background, but a non music playing app would be rejected if it used the "play music from the background" entitlement.

Duncan C
  • 128,072
  • 22
  • 173
  • 272
0

To do what you want, you would need to have something that triggered your app to run when it isn't. For example, a Bluetooth LE device could send a message to your app to make it run. Or you could have a push notification that does that. Also you could ask the system to run your app periodically in the background so that you could check the network.

There are other ways to do this, and many depend on your situation. Here's a pretty complete listing:

https://developer.apple.com/library/prerelease/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

mahboudz
  • 39,196
  • 16
  • 97
  • 124