问题
- Website Url: [redacted]
- Prompt works in Samsung Internet, Windows Desktop Chrome, Android Chrome
- Prompt does NOT work in Safari or Chrome for iOS
- Lighthouse tests pass (ignore the start_url error, whether or not I fix that has no effect. I've tried)
- PWA is installable on Android, iOS, and Windows
- Offline mode works as expected in the PWA
- When I run the lighthouse test, I get console error (even though image DOES exist): Error while trying to use the following icon from the Manifest: [redacted]/assets/icons/icon-144x144.png (Download error or resource isn't a valid image)
- Manifest is valid and no syntax errors
- The actual app is an Angular 9 app running at /app
- "Continue In Browser" button should disappear and be replaced with "Install The App" button when beforeinstallprompt fires
The PWA works on iOS, so why doesn't the prompt work?
回答1:
BeforeInstallPromptEvent API is supported by Chrome and Edge. Safari (Webkit) does not support it and on iOS all browsers are Webkit under the hood.
来源:https://stackoverflow.com/questions/62643717/beforeinstallprompt-not-firing-in-ios