How to pre-populate and hide site URL entry page?

Re: How to pre-populate and hide site URL entry page?

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

Hi Sourabh,

I tested it and your Moodle opened MoodleMobile official app after authenticating. If you haven't done it already, you should change the URL scheme your app uses (see the plugin documentation).

You should also change the URL scheme used by your local mobile in Moodle. Inside local_mobile plugin there's a file named launch.php with this line:

$location = "Location: moodlemobile://token=$apptoken";

If you change "moodlemobile" with your URL scheme it should open your app, but then it won't work for the official Moodle Mobile app.

If you want it to work both for your custom app and for MoodleMobile then you'll have to create a new script. You can just duplicate launch.php (with another name) and use your custom URL scheme in that new script. You should call this new script in your custom app, that is done in www/core/components/login/services/helper.js:

var loginurl = siteurl + "/local/mobile/launch.php?service=" + mmCoreConfigConstants.wsextservice;

You should replace "local/mobile/launch.php" with the location of your new script.

I hope this helps!

Kind regards,

Dani