• Google usually works much better than the forum search.

  • @stephan108 , you may want to look at this topic on the forum. There are other topics also.... Best to just search the forum with 'bottle'

    Will give you a lot of ideas

  • @JonB @omz Thanks for incorporating this suggestion into the latest test version. Works perfectly!

  • try this. I misunderstood what you wanted to do... there is a function which checks if you are in the background. You may need to play with the first sleep to ensure you are in the bg. or have a loop that sleeps while not in background, then second that sleeps while it is..

    import console,time #launch you app time.sleep(1) while console.is_in_background(): time.sleep(1) #launch your app time.sleep(1) while console.is_in_background(): time.sleep(1)
  • Modified the code and it finally worked.

    # coding: utf-8 from objc_util import * import appex SFSafariViewController = ObjCClass('SFSafariViewController') def open_in_safari_vc(url): vc = SFSafariViewController.alloc().initWithURL_entersReaderIfAvailable_(nsurl(url), True) app = UIApplication.sharedApplication() if app.keyWindow(): window = app.keyWindow() else: window = app.windows().firstObject() root_vc = window.rootViewController() while root_vc.presentedViewController(): root_vc = root_vc.presentedViewController() root_vc.presentViewController_animated_completion_(vc, True, None) vc.release() def main(): if not appex.is_running_extension(): print 'This script is intended to be run from the sharing extension.' return url = appex.get_url() if not url: print 'No input url' return open_in_safari_vc(url) if __name__ == '__main__': main()
Internal error.

Oops! Looks like something went wrong!