Moodle App custom url

Moodle App custom url

by Magalí Lescano Correa -
Number of replies: 12

Hello everyone!

I am trying to create my own custom Moodle app following the steps from: https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2#Install_a_browser_for_development

I have already cloned the app from https://github.com/moodlehq/moodleapp and I could make it work on the browser.

The only problem I have is that  the Moodle App doesn't open my url automatically. Moodle App asks me to insert the url:



I edited the /package.json and /config.xml files and specified there my custom URL_SCHEME following this format: https://docs.moodle.org/dev/Open_the_Moodle_app_from_another_app

This is what I added in the config.xml:   

<variable name="URL_SCHEME" value="moodlemobile://https://workplace.factoriadigitalpremium.es" />
package.json:
  "cordova-plugin-customurlscheme": {
        "URL_SCHEME": "moodlemobile://https://workplace.factoriadigitalpremium.es"
      },

Web services for mobile devices are enabled in my site.

I tried adding the URL_SCHEME in my site too, but there is an error saying the value is not valid:


I'm not sure if the format is correct of if there is any step I'm missing.
I've been looking in the forum and Moodle Documents but I couldn't find any further information or solution.

Thanks in advance.

Magalí

Average of ratings: -
In reply to Magalí Lescano Correa

Re: Moodle App custom url

by Vinod Singh -
HI Magalí,

Probably you are running into similar issue that I faced. Problem and a probable solution is mentioned here - https://moodle.org/mod/forum/discuss.php?d=397279

For initial testing you may leave URL scheme blank on server side.

Regards,
Vinod
Average of ratings: Useful (1)
In reply to Vinod Singh

Re: Moodle App custom url

by Magalí Lescano Correa -
Hello Vinod,
I tried what you said, but it is still not working.
If I finally find the solution I will let you know.
Thanks.
Regards,
Magalí
In reply to Magalí Lescano Correa

Re: Moodle App custom url

by Vinod Singh -
These intent-filters should be added under application/activity tag as shown below-

    <application . . .>
        <activity . . .>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="URL_SCHEME" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:host=" " android:pathPrefix="/" android:scheme=" " />
            </intent-filter>
        </activity>
    </application>
See if you are adding intent-filters at right place.

Regards,
Vinod
Average of ratings: Useful (1)
In reply to Vinod Singh

Re: Moodle App custom url

by Magalí Lescano Correa -
I don't have the AndroidManifest.xml file, so I created one adding the code.
Does this file require more code than just the one you posted above?
Thank you very much for your help.
Regards,
Magalí
In reply to Magalí Lescano Correa

Re: Moodle App custom url

by Vinod Singh -
If you are using ionic/cordova to build the app then AndroidManifest.xml can be found under "platforms/android/app/src/main/" folder.
Average of ratings: Useful (1)
In reply to Vinod Singh

Re: Moodle App custom url

by Magalí Lescano Correa -
Hello Vinod,
That worked!! Thank you very much for your help!
In my case I had the code in AndroidManifest.xml, but I had to change the url scheme in
   <data android:scheme="URL_SCHEME" />
Once again, thank you very much!
Regards,
Magalí
In reply to Vinod Singh

Re: Moodle App custom url

by We Blend Web -

No.

It's not working.

Should I add both the <intent-filter>s or only one of them?

getting a blank screen while loading the app.