According to the Android documentation:

In order to show the install dialog, you need to:

Listen for the beforeinstallprompt event
Notify the user your native app can be installed with a button or other element that will generate a user gesture event.
Show the prompt by calling prompt() on the saved beforeinstallprompt event.

The module only provides the manifest.json, and does not listen for this event.

Comments

malcomio created an issue. See original summary.

phillamb168’s picture

StatusFileSize
new539 bytes

(sorry, this was for 8.x)

christiansanders’s picture

Drupal 7 version

christiansanders’s picture

malcomio’s picture

Status: Active » Needs review
malcomio’s picture

@ChristianSanders I haven't seen any documentation about the start_url or display options - please could you share a link to the details?

I was expecting a patch closer to the 8.x one provided by @phillamb168, but if these options fix the problem, then that would be good.

christiansanders’s picture

I totally forgot to add the JS needed to! I shall get that into the patch now. If you check the diff, I updated the URL for the documentation. I've been playing with this since 7.30am and this was what finally worked for me :)

christiansanders’s picture

StatusFileSize
new2.39 KB

I apologise, I thought I had updated the documentation URL!

I have now done so in this forthcoming patch. I've now added the JS too.

christiansanders’s picture

StatusFileSize
new2.77 KB

And I totally binned it and forgot to actually add the JS file. Not going well today :) Here is the new patch.

malcomio’s picture

Status: Needs review » Fixed

I refactored the patch slightly, so that the JS file is in /js/ rather than /includes/, and committed it.

Still not entirely sure how the start_url value is used - it seems to relate to PWAs, rather than native apps, as far as I can see from https://developer.mozilla.org/en-US/docs/Web/Manifest/start_url - but I've left it in.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.