-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add "Install" and "Open In App" buttons #10
Comments
That's a nice feature! |
I think this script should be on the template instead of app.js right? |
At the moment, it's a SPA, so app.js is the only script (besides the service worker). I was thinking, though, of a twig component that handled everthing. <twig:pwa-install
installButtonText: {{ 'pwa.install'|trans }},
installButtonIcon: 'bi bi-download',
installButtonClass: "btn btn-primary"
launchButtonText: {{ 'pwa.launch'|trans }},
launchButtonIcon: 'bi bi-open-file',
launchButtonClass: "btn btn-success"
>
{# or with named blocks #}
<twig:block name='install' >
<button class="btn btn-warning" id="install">Install</button>
</twig>
Yes, it works that way in my demo, but I'm not sure how to create an "Open in App" if it's installed but running on the website. |
I read this blog post where it explains how to detect if the app is installed. I will test it when back home. |
The install button logic is working for me now at https://noise.survos.com I think the mp3 problems is fixed as well, as the app seems to be working offline. I don't see the install button when I go to the same URL on my Android phone, though, not sure why. |
Looks great. Can you just change the start_url parameter? It indicates ./index but should be / or. / I think |
I changed it, not sure if it makes a difference though. Alas, the mp3 offline still doesn't work. Should I try with 1.1.x? |
I installed the app, quit, disabled Internet and the app failed because the path was not in cache. Works fine now.
With the last release and the correct regex, the file should be served correctly. I cannot test as I don't have my computer with me right now, but I really think it should work:
|
Works now, thanks! I will close Spomky-Labs/pwa-bundle#81 |
To show off the "app" ability of the bundle, can you add an install and open in app buttons?
To app.js, add
And then an install button on the page. In my apps, I'm using bootstrap, not sure how to style an install button here. Also, I have bootstrap-icons installed.
I'm not sure how to add the "open in app" button, I think it has something to do with the manifest, but an example where would be most welcome.
Thanks for adding the "online/offline" notification.
The text was updated successfully, but these errors were encountered: