Reputation: 2129
Firstly, I'm aware of how to save a web URL to a smart device as a user as is explained in these answers (usually by saving the tab from the browser). These take multiple steps and vary depending on device, thus requiring research which most vanilla users of smart devices do not do.
Create a Android launch icon for Website
Add to homescreen on mobile phone
My question is from the perspective of the app owner. The end goal is to let create a link on the web app allowing users "Create Homescreen icon" from 1 click. I suspect this is not possible as it would create a huge security risk to the devices allowing random unsafe URL'S to potentially try and create unlimited shortcuts but I'd like to ask nonetheless.
Answers such as these make a URL support app creation, however it leaves the task of creating the shortcut to the user instead of the URL.
"Add to homescreen" button in Android does not show website as a Web App
I hope my question is clear enough, if it is not I'm more than willing to elaborate.
Upvotes: 0
Views: 3990
Reputation: 16597
Chrome on Android two new features 1) Web App Manifest that describes what should be launched from the home screen and how it should look on the homescreen, and 2) Chrome now has an beforeinstallprompt
event that will trigger for Web apps that we think are app-like and can be installed to the homescreen.
There are a number of criteria for the onbeforeinstallprompt
event to fire.
The event only fires if:
If all you want to do is detect if you should display a banner to prompt the user to add your web-app to the homescreen then Chrome already has a solution for you.
We also have a full range of samples on our samples site.
Upvotes: 1