I've written a simple WiFi based App using TCP on Network.Framework that receives about 80 bytes every 10s from a remote service on specific port. I want to write this data to file while in the foreground and the background.
The question is which of the background modes if any/is permitted/best fits this requirement?
All wisdom gratefully accepted.
Without knowing anything else about your app (is it a music app?, location?, VoIP?, bluetooth?) it's hard to say what you might do. But there are two classes of background actions:
The first doesn't really apply to you since this is ongoing. Of the second items, I'd guess that "Background fetch" is the one that fits best.
Note that you won't necessarily be called as regularly as you might like. But since your time interval is quite long (10sec) then a few hundred milliseconds latency wouldn't be particularly damaging I'd guess.
But also note that "Enabling this mode is not a guarantee that the system will give your app any time to perform background fetches. The system must balance your app’s need to fetch content with the needs of other apps and the system itself."