Automatically open hyperlinks in Moodle App

Automatically open hyperlinks in Moodle App

by Richard van Iwaarden -
Number of replies: 3
Picture of Particularly helpful Moodlers

I'm a Noob concerning Mobile phones. Actually, I just hate them. But anyway, I have a question about the Moodle app and hyperlinks.

My users asked me: if I get a hyperlink from you (for example via MS Teams Chat on mobile phone) and I click that link, it opens in a browser. Can I set it so that it will always open in the Moodle App on my phone?

Of course this should not happen if the same link is followed on a laptop.

So what I was thinking...

  1. Link is clicked
  2. Device is checked
  3. Laptop -> Open link in browser (this is standard behaviour)
  4. Mobile Phone -> Check hyperlink. If it's to our Moodle website, check if app is installed. If app installed, open in Moodle app. If not, open in browser

Is step fout possible? Is it a setting you can do on a phone and can I document that? Or is it something we need to add to our Moodle App (we have our own branded app)

Hope someone can help me a bit in this direction.

Average of ratings: -
In reply to Richard van Iwaarden

Re: Automatically open hyperlinks in Moodle App

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers
Hi Richard,

if the link is clicked inside the Moodle app, the app will always try to open it inside the app (if the feature is supported). You don't need to do anything special in there, just use a regular link like you do in laptop.

It gets trickier in mobile browsers. You can use a custom URL scheme to launch the app from the browser as it's explained in this guide. However, as far as I know clicking this link in a laptop won't do anything. And I think the same happens if the app is not installed, I think it won't open the Google Play / App Store (but you might want to verify this).

The first problem (laptop) can probably be fixed with a custom Moodle filter to use the normal link or the custom URL scheme depending on the device. So teachers can use regular links and then your filter can replace them with the app URL scheme format if you detect that the user agent belongs to a mobile browser.

As for opening Google Play / App Store, if it's not opened automatically then you might have to add a second link to open the store, but it's not a good solution in terms of UX. Maybe there are better solutions, I don't know much about that part.

Cheers,
Dani
In reply to Dani Palou

Re: Automatically open hyperlinks in Moodle App

by Wert Zuz -

Hi Dani, 

Isn't there the "open supported links" feature on android where applications could register for links to be opened by them. Would be very nice since receiving a link to a course for my university will open it in browser having me sign in again instead of just in the app.

Please add this feature to the Moodle app. 

Kind regards

In reply to Wert Zuz

Re: Automatically open hyperlinks in Moodle App

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers
Hi Wert,

I'm not an expert in this area so I might be wrong, but as far as I know in order to do that an app needs to declare in the app's manifest the domains (URLs) that wants to open, it's not something done dynamically. Since the Moodle app is used to connect to any Moodle site it's not feasible to support this, since we'd need to declare in our manifest the URLs of all the Moodle sites out there.
 
There is more information in this Android documentation, under the "Web links" and "Android App Links".
 
Kind regards,
Dani