Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not working correctly on PWA Android Chrome #5

Open
GVAMDaniel opened this issue Nov 13, 2023 · 0 comments
Open

Plugin not working correctly on PWA Android Chrome #5

GVAMDaniel opened this issue Nov 13, 2023 · 0 comments

Comments

@GVAMDaniel
Copy link

I have compiled my application to run on the web, and I have uploaded it to a server following the step-by-step instructions in both the README.md and https://web.dev/learn/pwa/.
I have added the icons and corrected the manifest.json to eliminate any errors.

My application also utilizes the flutter_native_splash plugin.

On the web from a computer, the plugin works perfectly. I have a button that, when pressed, launches the function

PWAInstall().promptInstall_()

and the prompt appears without any issues. However, on an Android device with Chrome, the plugin does not behave as expected.

When the application is launched, the prompt automatically appears while the splash_screen is visible, but it only appears at that moment and never shows up again.

I have tried triggering e.preventDefault() within

window.addEventListener('beforeinstallprompt', (e) => { e.preventDefault(); deferredPrompt = e; });

But then it never appears again, even when invoking the function

PWAInstall().promptInstall_()

I have no clue how to make this plugin work correctly on Android Chrome. It seems that, in the end, I'll have to resort to launching a custom modal for users to manually install it from the options menu.

Unless there's someone who has managed to make it work seamlessly on Android.

Greetings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant