but [music playing apps] work during background, what is the difference?
iOS has affordances for certain types of apps, allowing those apps to run in the background under specific user scenarios. Music playing apps are one such example. Check out the Background Execution section of the App Programming Guide for iOS.
These are not, however, general-purpose background execution facilities. Each of these background modes was designed for a specific user scenario and only works well in that scenario. For example, a turn-by-turn navigation app can run indefinitely in the background but only if navigation was started while the app was in the foreground.
In addition, App Review pays very close attention to the background modes each app uses, requiring that their use be aligned with user expectations (see clause 2.5.4 of the App Store Review Guidelines).
The scenario you’ve described, polling a web service every 5 minutes, is very unlikely to match any of these background modes. The only one that might seem like a good match is the
fetch
background mode, but that’s not going to work for you (see
this post for some context). Which brings me back to the recommendations I made in my previous post.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"