iPhone SDK – Add a “Add to Home Screen” button in a UIWebView

[I presume your question is about replicating the action associated with add to home screen, rather than replicating the appearance of the button itself (which being pedantic is what you actually wrote).]

As others have said this isn’t possible.

What you could do is programatically launch Safari from within your app and give it the URL of a page to load which is your page.

When your page is loaded it has some sort of animation and shows the user where the add to home screen button is and tell them to press it after clicking a link which is displayed in your web page. When the users click on the link it takes them to whatever page it is that you would like saved to the desktop, and you hope they follow your instructions.

If you register your app to handle a proprietary url scheme the users can get back to your app from within Safari by clicking on a link using your app’s url scheme.

The web pages that you seed Safari with must however be remote pages, you cannot give Safari a page in your app’s bundle or that your app has downloaded as Safari cannot read pages from your app’s sandbox.

Leave a Comment