I was hoping to be able to write a script which would fetch some stock quotes every n minutes in the background and store them. By "background" I am referring to 2 cases (a) the iPad is running another app or (b) the iPad screen is off. From what I have read or tried, (a) is possible but only for a limited amount of time and (b) does not work at all.
My question is why is this the case? There are many apps that run in the background. One such app that operates in both modes is TuneIn Radio. Is Pythonista's background limitation a function of Pythonista that could be relaxed or is it an IOS limitation that somehow does not affect certain apps?
I'm not sure it completely answers my question about whether Pythonista could conceivably run in the background, but I found this in an Apple doc:
Implementing Long-Running Background Tasks
For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background:
Apps that play audible content to the user while in the background, such as a music player app
Apps that record audio content while in the background.
Apps that keep users informed of their location at all times, such as a navigation app
Apps that support Voice over Internet Protocol (VoIP)
Apps that need to download and process new content regularly (my use case)
Apps that receive regular updates from external accessories
Apps that implement these services must declare the services they support and use system frameworks to implement the relevant aspects of those services. Declaring the services lets the system know which services you use, but in some cases it is the system frameworks that actually prevent your application from being suspended
Could somone please confirm that this script is a no-go due to the background execution limitation or if there is some workaround or any chance that this will be doable in a future release?
You could always try NoDoze: http://omz-forums.appspot.com/pythonista/post/5988988296888320
This looks like a far better solution...
Disable or enable the idle timer (which puts the device to sleep after a certain period of inactivity).