Search code examples
ioscocoa-touchios6browser

is there a way to have full control over a browser in a native iOS app?


I have a chrome plugin I've written that does stuff like:

  • sets cookies on the user's behalf
  • visits a certain sequence of urls, posting form data, and reading returned HTML and cookies (this has to be from a real browser, not a series of programmed http connections.)
  • opens tabs to specific urls

Basically in the chrome plugin world I have complete control to do almost anything (once the user agrees and installs the plugin.)

In there any way to do this in a native iOS app? I realize there is no plugin system for either safari or chrome on iOS. Do I stand a chance using UIWebView? Or is UIWebView way too limited? Is there a complete webkit or mozilla browser code in Objective-C I can use and modify for my needs? Thanks!


Solution

  • This is most definitely possible if you are building a native iOS application.

    1) You can communicate with cookies with the NSHTTPCookieStorage APIs.

    2) You can send network requests and process their data on a background queue, after which you can then set the HTML content of the UIWebView (on the main queue.)

    3) Your "tabs" can simply be sibling view controllers which each contain a UIWebView.