118
Views
3
Comments
Solved
PWA installation
Application Type
Mobile

Hi all,

We have a mobile app that we are distributing as a PWA. It is important for one of our clients that they be able to install the application and therefore it is important that we consistently provide them with the option to install the PWA.

We have managed to customize the installation prompt for the PWA by listening for the 'beforeinstallprompt' and that seems to be working like a charm. However the experience is not consistent. The 'beforeinstallprompt' event does not always fire as expected and since we are relying on it there isn't really anything that we can do if it does not fire.

I understand that there are some checks that the browser does to determine whether the event should fire, but as far as I am aware I should pass all these checks. The event still does not fire consistently. 

Is there a better way of prompting the user to install a PWA or maybe a way to force the browser to fire the event or at least do the checks again?

Kind regards

Stefan

2023-12-07 07-51-40
Remco Dekkinga
 
MVP
Solution

Hi Stefan,

The following page shows in the beginning which checks the browser does.

https://pwa-workshop.js.org/5-pwa-install/#criteria-for-being-installable

You've probably already seen this or similar pages with these checks, but in case you missed it... This is the actual checklist for browsers before triggering the "beforeinstallprompt" event. When it doesn't trigger, one of the checks didn't work or the browser (version) doesn't support the event.

Is there a way to double check with the people that are facing the issue if the problem is reproducible and if they have not yet installed the app before?

You could ask the users that are facing issues to try out the following URL, which is a basic implementation of the install banner. When this one also doesn't work for them, the problem is not on your side ;)

https://googlechrome.github.io/samples/app-install-banner/basic-banner/index.html 

Good luck!

Remco

2020-12-07 12-30-07
Stefan van Deventer

Hi Remco,

Thank you for your response. 

I checked the criteria again and noticed that the display was set to browser and not standalone which is why the event wasn't firing. When I went to look in Service Studio the application was not being distributed as a PWA anymore, though we definitely set it to be distributed as a PWA at some point in the past.

I will investigate as to why this was changed, but that would explain why the event wasn't firing as it should have anymore.

Thanks

Stefan

2024-04-18 05-58-56
Rupesh Wani

Hi Stefan,

If it does solved your problem, are you able to share the OML here?

Thanks,

Rupesh

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.