Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Background location notifications
-
@omz, I was wondering if it would be possible to enable background location updates in pythonista. This would reauire the user to select a script to be called, similar to today widget. Then if so is stopped due to memory / background limits, when the notification arrives, the user script would be called.
This would enable all sorts of interesting applications. But I wasn't sure if this requires an entitlement that is not enabled. A while back I think I was able to swizzle the applicable methods when app resumes, but obviously that only works if the app is still running in the background, but not if the OS killed it for memory.
-
@JonB I've tested the notification in Pythonista beta, lauching a little script when Pythonista is in background. The script updates a file each 10 seconds. After less than one minute (not always the same delay), the process stops.
To check the process without setting Pythonista in foreground, the updated file is in iCloud Drive, thus I'm able to check if the process continues with the Apple Files app. -
I had similar behavior in the past. But apps like navigation apps can obviously do small bits of work in the background for long periods. According to docs, the app gets restarted with a location key in options. My thought was if pythonista had a way to hook user scripts into applicationDidFinishLaunchingWithOptionn, it would allow perhaps certain types of background ops (Bluetooth events, or location events I think both can do this). I'd imagine this is an extra entitlement which would be problematic, but I wasn't sure.
-
@JonB Thanks for your explanation. You are always so patient with the (old) neophyte I am.
Sincerely, I'm sure a lot of people here would be lost without your help.