React Hook for showing custom "Add to homescreen" prompt
(For >=React v16.7.0-alpha)
Simple React Hook for showing the user a custom "Add to homescreen" prompt.
const [prompt, promptToInstall] = useAddToHomescreenPrompt();
Listens for "beforeinstallprompt" event (notifies you when the browser would have shown the default dialog), intercepts it and lets you take over and show the prompt when ever you please.
Only works after certain criteria is fulfilled:
Browser support is still quite lacking. At the time of writing, only Chrome (Desktop + Android) is supported.