In the last post I had shared with you how to make the browser show a "Add to Home Screen" dialog box in Mobile devices. It is possible in both Android, iOS and even on Latest desktop browsers too. This feature is available in modern web browser and it helps us to install the PWA in user's device. In this post we will learn how to show Add to Home Screen prompt when user clicks a button. The dialog box like the image below will popup on user's screen once they click the button designed to do that task. Below is the Add to home screen popup dialog box . To popup add to home screen dialog box all we need to do is - Trash the beforeinstallprompt Call deferredPrompt.prompt() when a custom button is cliked Who wants to waste time in reading. So here's the code for you. NOTE : manifest.json and service-worker.js file needs to be available in the same directory. Refer to last post to learn how to do that. Check and download source co...
Read ● Learn ● Implement