Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Add to Home Screen Pop up on Site Open in mobile browser

How to get this pop up in mobile browser . when  we click to Add to home Chrome icon generate on Home screen of mobile

How to get this pop up in mobile browser "Add to home" will create icon of chrome on home screen of mobile with site link on mobile.

Please suggest the solution.

like image 707
Niral Bhavsar Avatar asked Dec 19 '15 11:12

Niral Bhavsar


People also ask

How do you add add to homescreen popup in website?

Open the menu next to the URL bar. Depending on whether you're using Chrome or Android you'll see a menu option "Install" or "Install App". This is the "Add to Home screen" option displayed for any site that has the necessary features in place.

Why is add to home screen not an option?

If you do not see the "Add to Home Screen" option after you have opened the Mobile Gallery App installation link, you are most likely viewing from an unsupported browser (i.e. using the Gmail app on an iOS device, or the Twitter app from an Android device).


2 Answers

Official requirements are:

Chrome automatically displays the banner when your app meets the following criteria:

  • Has a web app manifest file with:
    • a short_name (used on the home screen)
    • a name (used in the banner)
    • a 144x144 png icon (the icon declarations must include a mime type of image/png)
    • a start_url that loads
  • Has a service worker registered on your site.
  • Is served over HTTPS (a requirement for using service worker).
  • Is visited at least twice, with at least five minutes between visits.

source: https://developers.google.com/web/fundamentals/engage-and-retain/app-install-banners/

You can skip these requirements for testing or debugging purposes by enabling a chrome flag:

chrome://flags/#bypass-app-banner-engagement-checks

chrome flag bypass user engagement checks

like image 166
Lukasz Wiktor Avatar answered Oct 04 '22 15:10

Lukasz Wiktor


In your service worker js file have this single line.

self.addEventListener('fetch', function(event) {}); 
like image 36
imsinu9 Avatar answered Oct 04 '22 15:10

imsinu9