pwa.rocks | A selection of Progressive Web Apps | Frontend Framework library
kandi X-RAY | pwa.rocks Summary
kandi X-RAY | pwa.rocks Summary
A selection of Progressive Web Apps
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pwa.rocks
pwa.rocks Key Features
pwa.rocks Examples and Code Snippets
Community Discussions
Trending Discussions on pwa.rocks
QUESTION
We want to make our own app store as a website where all the "apps" are PWAs. Since people aren't yet used to the "Add to home screen" feature of PWAs, we want to make all the apps in our app store instantly launch the "Add to home screen" feature of the PWA.
For example, https://pwa.rocks/ is a nice "app store." But to add it to the home screen, users have to first navigate to the page, and then they are prompted to add it to the home screen. We want to skip step one entirely.
...ANSWER
Answered 2019-Jan-23 at 23:36Your use case seems prone to abuse and has the potential to do serious damage both to your brand as well as the general perception of PWA's by your customers.
However, to answer your question, you could try using frames or iframes to achieve this. Here are the criteria to get the Add to Homescreen banner to show up:
- The web app must not already be installed
- Must meet a user engagement heuristic (currently, the user has interacted with the domain for at least 30 seconds)
- Must have a web app manifest that includes:
- short_name or name
- icons must include a 192px and a 512px sized icons
- start_url
- display must be one of: fullscreen, standalone, or minimal-ui
- Must be served over HTTPS (required for service workers)
- Must have registered a service worker with a fetch event handler
When these criteria are met, Chrome will fire a beforeinstallprompt event that you can use to prompt the user to install your Progressive Web App.
Other browsers have different criteria for installation, or to trigger the beforeinstallprompt event.
Source:
https://developers.google.com/web/fundamentals/app-install-banners/
QUESTION
I have been working with PWA (progressive web apps) for quite some time but recently I wanted to show to another person the A2HS Pop-up (add to home screen) functionality and It does not trigger on ANY PWA on my phone or theirs.
Listing examples from https://pwa.rocks or even my own, have an 100% PWA pass rate on lighthouse, the pop up gets triggered normally if you use the application console, but it just doesnt appear organically.
I also registered the event "beforeinstallprompt" to send console logs but nothing.
Are there actual specifications for when the prompt becomes visible? What has changed over the course of 1-2 months that stopped the pop up from occurring?
...ANSWER
Answered 2018-May-28 at 07:17There are certain spec changes recently. Going ahead, starting from chrome version 68, the developer will have to manually trigger the prompt by capturing the beforeinstallprompt
, deferring it if required, and calling prompt()
method on it as and when required. More on it can be read from the official document, which states the updated requirements as:
- The web app is not already installed
- Meets a user engagement heuristic (currently, the user has interacted with the domain for at least 30 seconds)
Meets the Progressive Web App criteria:
(a) Includes a web app manifest that includes:(i) short_name or name
(ii) icons mustinclude a 192px and a 512px sized icons
(iii) start_url
(iv) display must be one of: fullscreen, standalone, or minimal-ui
(b) Served over HTTPS (required for service workers)
(c) Has registered a service worker with a fetch event handler
Also, now coming to the second part of why beforeinstallprompt
not getting fired and not sending console outputs. The reasons can be:
- "You can only call prompt() on the deferred event once, if the user dismissed it, you'll need to wait until the beforeinstallprompt event is fired on the next page navigation." So essentially what this might mean is that if you might have cancelled the event or closed the pop up, it might not even get triggered again. AFAIK, there's a cool off period which can go on till 90 days.
- "If the web app manifest includes related_applications and has 'prefer_related_applications': true, the native app install prompt will be shown instead." There can be a possibility of setting the prefer_related_application flag to true and missing out on mentioning the related_applications tag. Hence, none of the installation prompts might appear.
- Make sure the you are not testing "A2HS" flow on the desktop (use remote debugging instead). Because as given in this article, "Chrome has a slightly different install flow for desktop and mobile. Although the instructions are similar, testing on mobile requires remote debugging, without it, it will use the desktop install flow." and "For Mac or Windows, you'll need to enable the #enable-desktop-pwas flag".
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pwa.rocks
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page