jaurand
jaurand

Reputation: 11

beforeinstallprompt not fired until touch if site opened from link in sms message

I have a PWA that works as expected when the address is entered into the Chrome browser on an Android device (Currently using Chrome 76 on Android 9). When the site is loaded I get the beforeinstallprompt event and display my installation message. However, if the site is opened from a hyperlink in an SMS message then I don't get the event until tapping on the page. Is this expect? Has anyone dealt with this issue?

Upvotes: 1

Views: 987

Answers (1)

Dracorex
Dracorex

Reputation: 379

As stated here, it is a requirement that the app "meets a user engagement heuristic" before beforeinstallprompt fires. Since the user came from an external link, the browser requires that the user demonstrate that they want to engage with the app that they landed on; they didn't just click a link and land there. Entering the address manually is sufficient to show engagement: they deliberately came to the site of their own accord.

It is like how a YouTube video opened from an external link will not have sound until the user interacts with it. The browser is preventing sound from playing unless the user shows that they want it since unsolicited auto-playing sound is a common annoyance for users.

Upvotes: 1

Related Questions