Moodle mobile not accepting custom url

Moodle mobile not accepting custom url

by Olalekan Adeniyi -
Number of replies: 8

I have been trying to add a custom url to moodle app but its not accepting the url, it keeps appending "www" to the url. below is my structure:


{

    "app_id" : "org.edutechportal.mobileclass",

    "appname": "Mobile Class",

    "versioncode" : "2016",

    "versionname" : "1.0.1",

    "cache_expiration_time" : 300000,

    "default_lang" : "en",

    "languages": {"ar": "عربي", "bg": "Български", "ca": "Català", "cs": "Čeština", "da": "Dansk", "de": "Deutsch","en": "English", "es": "Español", "es-mx": "Español - México", "eu": "Euskara", "fa": "فارسی", "fr" : "Français", "he" : "עברית", "hu": "magyar", "it": "Italiano", "ja": "日本語","nl": "Nederlands", "pl": "Polski", "pt-br": "Português - Brasil", "pt": "Português - Portugal", "ro": "Română", "ru": "Русский", "sv": "Svenska", "tr" : "Türkçe", "zh-cn" : "简体中文", "zh-tw" : "正體中文"},

    "wsservice" : "moodle_mobile_app",

    "wsextservice" : "local_mobile",

    "gcmpn": "694767596569",

    "customurlscheme": "mobileclass",

    "siteurl": "https://lms.cdlce.domain.edu.ng/",

    "skipssoconfirmation": "false",

    "forcedefaultlanguage": "false"

}


Average of ratings: -
In reply to Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

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,

please make sure the URL is valid. If I open it it says it's not a valid domain.

Kind regards,

Dani

In reply to Dani Palou

Re: Moodle mobile not accepting custom url

by Olalekan Adeniyi -

The url is valid: below is the url to the APP on play store and also the hosted website

Website

https://lms.cdlce.uniabuja.edu.ng

Playstore

https://play.google.com/store/apps/details?id=org.edutechportal.mobileclass

In reply to Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

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

The URL included in the config.json you pasted in here and the one you just sent are different:

https://lms.cdlce.domain.edu.ng/

https://lms.cdlce.uniabuja.edu.ng

In reply to Dani Palou

Re: Moodle mobile not accepting custom url

by Olalekan Adeniyi -

I only did not want to expose the domain before. the domain is https://lms.cdlce.uniabuja.edu.ng and i have tried it several times.

In reply to Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

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

In which device are you testing?

I just tried it in Android and iOS and it worked fine. In Chromium (testing) it uses http instead of https because the following request is failing:

https://lms.cdlce.uniabuja.edu.ng/login/token.php?username=a&password=b&service=c

In browser we need to send those fake params to avoid CORS problems. If you open this link you'll see it returns an "Internal script failure".

In reply to Dani Palou

Re: Moodle mobile not accepting custom url

by Olalekan Adeniyi -

I was previously testing with chromium, even when i tested with chrome browser, it gave the same error.

Please see link below for screenshot.

http://joxi.ru/vAWb4EjckORl52

Thanks


In reply to Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

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,

if you check the console, the first error it's showing is:

TypeError: Cannot read property 'errorcode' of null

This is because the app expects to receive errors as JSON objects (that's how the login/token.php script works). But it is receiving a string instead: "<br /><b>Error</b>: <font color="FF0000"><b>Internal script failure</b><br />".

Since the app is receiving a value that doesn't expect, it fails and then it tries to connect again modifying the URL. When you enter a site URL, the app will always do this:

  • Try to connect using https.
  • If it fails, try to connect using https and adding or removing www.
  • If it fails, try to connect using http.
  • If it fails, try to connect using http and adding or removing www.

Please fix that error (Internal script failure) and try again.

Kind regards,

Dani

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

Re: Moodle mobile not accepting custom url

by Olalekan Adeniyi -

Ok, Thanks Dani,

I would fix that and see how it goes, I really appreciate you time.