The App Install Banner is not displaying for bitmage on their site, delta.countyfence.org. They want to prompt users to install their site as a Progressive Web App (PWA), but the current setting only offers installation from the app store, which is not the desired behavior.
Falco suggests that the PWA install banner should display when the app store installation settings are not checked, but bitmage is not seeing the banner even after unchecking those settings. Falco mentions that Firefox doesn’t support the PWA install banner.
bitmage discovers that the PWA install banner is not exclusive to Google Chrome and can be supported by other browsers, such as Brave. They also find that the beforeinstallprompt event only triggers once, and there is no manual way to activate the “install as app” API.
The Discourse code checks for the beforeinstallprompt event, but also adds an additional check to see if the Discourse banner has ever been dismissed, which bitmage believes is a missed opportunity to present the banner again. They suggest leaving this up to the admin to decide whether to prompt in this circumstance. Arkshine mentions that they saw the banner once, but it didn’t appear again after clearing the cache.
I unchecked those two boxes just to test. Loaded in firefox on mobile. I’m not seeing a banner so far… You’re saying a PWA banner should display when those boxes are not checked?
It looks like PWA should be supported in browsers besides Chrome. I know I installed the PWA from Brave, so my browser certainly supports it.
beforeinstallprompt only triggers once - if the user dismisses it it’s gone. Apparently to avoid hassling the user?
There doesn’t appear to be any manual way to activate the “install as app” API.
Does the Discourse code check specifically for Chrome or does it respond to beforeinstallprompt in any browser? (seems non-browser specific, see code link below)
This looks like the original announcement of the feature in Chrome. It seems like the intention was to allow developers to hang onto the event object, and be subtle about the way they are displaying it to the user. If the user ignores it, it should pop up again next time. Only if the user initiates the prompt and then cancels out should it disable the event for a time (e.g. 3 months).
The Discourse code responsible for this, however, adds an additional check to see whether the Discourse banner has ever been dismissed. Am I understanding that correctly? It seems like a missed opportunity, we could be presenting the banner again but are choosing not to. What if we left this up to the admin, whether they want to prompt in this circumstance?