Moodle mobile not accepting custom url

Moodle mobile not accepting custom url

Olalekan Adeniyi -
Atsakymų skaičius: 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"

}


Įvertinimų vidurkis: -
Atsakymas į Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

Dani Palou -
Core developers paveikslėlis Moodle HQ paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

Hi,

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

Kind regards,

Dani

Atsakymas į Dani Palou

Re: Moodle mobile not accepting custom url

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

Atsakymas į Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

Dani Palou -
Core developers paveikslėlis Moodle HQ paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

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

Atsakymas į Dani Palou

Re: Moodle mobile not accepting custom url

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.

Atsakymas į Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

Dani Palou -
Core developers paveikslėlis Moodle HQ paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

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".

Atsakymas į Dani Palou

Re: Moodle mobile not accepting custom url

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


Atsakymas į Olalekan Adeniyi

Re: Moodle mobile not accepting custom url

Dani Palou -
Core developers paveikslėlis Moodle HQ paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

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