How To: Save image from iOS WebView to the user’s Photos app ๐Ÿ–ผ

Sometimes it could be useful to save images to the iOS camera roll of your appย user.

Here is how to:

  1. Download theย WebView Xcode template
  2. Define your URL (or your local HTML folder)
  3. Insert this HTML into your website:
<a href="savethisimage://?url=">Save this image</a>

You are done! ๐Ÿ™‚

If you want an automatic download (instead of a link), just redirect to the API URL scheme:

var imgurl = "";
window.location.href = "savethisimage://?url="+ imgurl +"";

Enjoy! ๐Ÿ™‚ If you have any questions, please feel free to ask.

Interested in all-inclusive WebView app service for iOS and Android?
Check out the service!