Open KarlBaumann opened 3 years ago
"install" returns null on Chrome desktop on MacOS.
I would suggest to do something like this
const { supportsInstall, triggerInstallPrompt } = usePWAInstall()
instead of hiding everything in one variable.
Do you fulfill PWA requirements set by Chrome? Do you have service worker and webmanifest? https://web.dev/install-criteria/
Do you use supported browser? (Yes, you do.)
Did you already installed the app?
null
is returned if the app can't be installed.
Everything is fine if I click on the icon in the address bar. Only the button does not work. Button works fine on mobile browsers though.
I see. It happens to me too on another project. I will investigate. I suspect some Apple weirdness. Chrome on Windows works.
To the original request I've made a demo on Glitch https://glitch.com/edit/#!/react-use-pwa-install-demo.
Could you maybe create an example on the code sandbox, because I am not able to get the button to work.