IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
5 stars 24 forks source link

[FEATURE] Direct links to open the app #1504

Open esmeetewinkel opened 2 years ago

esmeetewinkel commented 2 years ago

What? Direct links (and possibly QR codes) to the app, in particular,

Why? Use case is facilitators providing support through WhatsApp groups, they might want to send a link on WhatsApp that would launch the app that is installed on the phone and open it on a particular page.

How? (@chrismclarke commented on SLACK, pasted here for convenience) It's possible, but requires adding support for native deep linking. It can be a little fiddly (particularly on IOS), but the capacitor docs gives a good explanation for how to do this https://capacitorjs.com/docs/guides/deep-links

One point of note is that it will create a link between a specific web domain, and an app. This means if someone clicks to open a link such as: https://plh-za.web.app/template/weekly_workshops

Then if they have the plh_za app installed (or whatever other website-app mapping we recreate), it will route to that page in the app instead of opening a web browser. If they don't have the app installed it will just open in browser. We can also add a prompt to install the app from the browser version when running on a mobile browser if desired (like reddit and some other apps do)

This usually works reasonably well, although will need to be manually implemented for every app/deployment we want to configure, and so might need a bit of extra workflow magic to populate as required.

You can also add additional functionality to bypass the browser altogether, sending directly to the play store to download on url click and then route to the page after install, using Firebase Dynamic Links. This would have its own challenges as typically we redirect users when first visiting the app if they have not done the tour, so that feature might not work very well.

But adding standard deep links shouldn't be a huge issue. I'd recommend @jfmcquade give it a try first and I can support if he gets stuck. If useful you can also see the codebase of the sami maths club app which has deep links and an app install prompt.

App event listener https://github.dev/supportingami/sami-maths-club/tree/master/maths-club-app/src/app/app.component.ts#L65

Mobile install prompt https://github.dev/supportingami/sami-maths-club/tree/master/maths-club-app/src/app/app.component.ts#L57

Site association file https://github.dev/supportingami/sami-maths-club/blob/master/maths-club-app/src/static/.well-known/assetlinks.json#L3

jfmcquade commented 1 year ago

As some navigation is handled by setting fields, I believe that some of the functionality of #1726 will be required in order to link to an arbitrary page within the app.