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.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | appbanners-android-fix-d7-3047715-9.patch | 2.77 KB | christiansanders |
| #8 | appbanners-android-fix-d7-13159681-8.patch | 2.39 KB | christiansanders |
| #4 | android-chrome-smart-banners-3063939-2.patch | 1.66 KB | christiansanders |
| #2 | appbanners-android-fix.patch | 539 bytes | phillamb168 |
Comments
Comment #2
phillamb168 commented(sorry, this was for 8.x)
Comment #3
christiansanders commentedDrupal 7 version
Comment #4
christiansanders commentedComment #5
malcomio commentedComment #6
malcomio commented@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.
Comment #7
christiansanders commentedI 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 :)
Comment #8
christiansanders commentedI 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.
Comment #9
christiansanders commentedAnd I totally binned it and forgot to actually add the JS file. Not going well today :) Here is the new patch.
Comment #11
malcomio commentedI 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_urlvalue 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.