I have created a mobile website and it is working fine. Now I am creating a mobile home icon for both iPhone and Android. Is there any way for the user to create the home icon just by clicking a link in the website, rather than going through the bookmark options?
2 Answers
This is not possible on either Android or iOS.
Your best bet is to use an instructional popup script. There are many of these for iOS online but cubiq's version seems good.
Android is similar (with the default browser) and I'd recommend a similar solution although I cannot find an Android specific script.
Instructions for doing this on either OS can be found on this blog. Use with caution, however as the browser the user uses (as well as the OS version for Android) will require very different instructions!

- 3,133
- 18
- 33
-
-
1Unfortunately this post is over 10 years old, and with [link rot](https://en.wikipedia.org/wiki/Link_rot) being what it is, this is unfortunately expected. These answers may also be outdated as specification evolves. However, these links are on Archive.org: [Cubiq's iOS popup script](https://web.archive.org/web/20171112225527/http://cubiq.org:80/add-to-home-screen) [Mavenlink cross-device blog post](https://web.archive.org/web/20120809034616/https://www.mavenlink.com/community/blogs/785-add-to-home-screen-for-iphone-ios-and-android) – jaypeagi Aug 29 '23 at 09:14
Unfortunately, there isn't a built-in or standard way to programmatically add a home screen icon from a web page for either iOS or Android.
HOWEVER, you can go a PWA route. This will take some extra work and configuring, and it will still require a prompt to be made to confirm that the user would like to download your web app.
Resources for PWAs:

- 98
- 5
-
My app is already set up to be a PWA. Unfortunately, the solution provided in your first link is not at all standard and not even on track to be standard. https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent – dx_over_dt Aug 18 '23 at 20:06