0

I have an app that keeps collecting the device's sensor data and stores it in sqlite database. All this keeps happening continuously according to the timers that I set which are as follows:

-Every 1 second app collects sensor data

-Every 30 minutes the app sends collected data to aws iot

-Every 60 minutes an api is called to refresh the above timer values

Now, the requirement is that all this should keep on going even if the app has entered background state or if the phone goes to sleep(screen off and locked). I searched around and found the background task can help with this. So, I implemented a simple background task that starts when app enters background state. Now all this functionality works even when phone is locked or app is in background. I have not enabled any background mode capabilities in my project.

After reading a lot I think that this type of behaviour is rejected by Apple. In my case, would that be the problem? Will apple reject my app because my background task keeps running infinitely without any background mode enabled?

Need some clarification on this. Thanks alot.

Rishabh
  • 465
  • 5
  • 14
  • You background task won't keep running. Have you tried running your app when not connected to Xcode? Your app will be terminated after 3 minutes – Paulw11 Apr 14 '18 at 08:43
  • Oh, you mean that it only runs like that in debug mode? – Rishabh Apr 14 '18 at 09:51
  • Yes, when running under the Xcode debugger the background time restrictions are not enforced. – Paulw11 Apr 14 '18 at 10:06

0 Answers0