Is there a callback or some way to tell if the app is in the background/foreground?
import webrowser
webrowser.open('safari-http://')
# I want the next line to execute only when returning back to Pythonista
print "Back here"
I tried this work around but it always returns false (I would've wrapped it in a setTimeout and checked every 30ms)
ui.WebView().eval_js('document.hidden')