Buenas tardes! I've been researching for a while and I haven't found anything about it, I'm developing a website, and I'm interested in adding a function to create a shortcut on mobile.
To be more detailed, if we go to any web page from chrome in android, we have the option to create a shortcut, which will remain on the desktop. Pressing it, opens the web. Is there a way to do this but with a function? That is, when the web is opened, for example, a request is automatically made to add the site as a direct access?
From already thank you very much. I am developing the web with HTML, CSS and Javascript (I imagine that if possible, it will be done from js), but there would be no problem including other technology if necessary. I am aware!
I'm afraid it's not possible to do what you say.
The closest thing would be to make a popup with the instructions to do it and show it at the beginning of the application.
Try this library: https://github.com/cubiq/add-to-homescreen
It will help you with what I mention of the popup.
Well, the closest thing I've seen is the direct access of the pwa, the installer of the pwa, I tried it on localhost and it worked for me, to make it work correctly, look at the conditions: This link for the steps on how to create a wpa and handling service worker:
https://developers.google.com/web/fundamentals/primers/service-workers?hl=es
This is to put the button for the installer, for this step see the link above before:
https://web.dev/codelab-make-installable/
I hope it helps you a bit.