Launch Moodle App from within another app

Launch Moodle App from within another app

by Ken Masters -
Number of replies: 5

Hi

I am writing an app for my class and the app includes activities not in Moodle.  I would also like my students to be able to launch the Moodle App (assuming they already have it installed on their devices) from within my app.  (I am relatively new to app development, so I hope my question is not too immature).  As far as I know, I need technical information, specifically The App's "ActivityClass" and "ActivityPackage".  Does anybody know this information or where to get it (I have tried looking through the Moodle tech documentation, but can't find it there)?

Thanks

Kem

Average of ratings: -
In reply to Ken Masters

Re: Launch Moodle App from within another app

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hello Ken,

the Moodle Mobile app ID is com.moodle.moodlemobile. The rest of the values should be Cordova default values. I'm not sure if that is enough for you.

Also, we support Custom URL Schemes to launch the app. That is, if a user clicks a link with protocol moodlemobile:// the app should be launched if it's installed.

Kind regards,

Dani

In reply to Dani Palou

Re: Launch Moodle App from within another app

by Ken Masters -

Thanks Daniel, I managed to figure it out after running Logcat on a rooted phone.  (Sorry, I should have posted a "Solved" response here).  Thanks anyway.



In reply to Dani Palou

Re: Launch Moodle App from within another app

by Ralf Krause -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

Hi Dani,

what will happen when more than only one website is added in the Moodle Mobile app? A link starts with  moodlemobile://  but can you also chooze the website url and the user for the app?

Best regards,
Ralf

In reply to Ralf Krause

Re: Launch Moodle App from within another app

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Ralf,

the exact link needs to start with moodlemobile://link=YOURURL (as it's briefly explained in here). For example, the following link will open a choice in the site mysite.es:

moodlemobile://link=https://mysite.es/mod/choice/view.php?id=8

If the site is not registered in the app, the user will be sent to the login page (with the site URL already entered, it cannot be changed). If there is more than one user for that site in the app, the user will be able to choose which user does he want to use.

Also, you can specify the user to open the link with, for example:

moodlemobile://link=https://dpalou@mysite.es/mod/choice/view.php?id=8

If the site is not registered in the app with that username, the user will be sent to login page (in this case, the username will be typed already, but it can be changed). In this case it doesn't matter if there are several users registered in the app for that site, it will always use the user determined in the URL.

Kind regards,

Dani

Average of ratings: Useful (1)
In reply to Dani Palou

Re: Launch Moodle App from within another app

by Ralf Krause -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

Great!

This seems to be a very cool feature! You can take a qr code with a moodlemobile link to let everybody open a special course or a special activity with the Moodle Mobile app.