How to set fixed site url?
Number of replies: 9Re: How to set fixed site url?
Hi there,
You can find the latest version here: https://github.com/moodlehq/moodleapp
We stopped using PhoneGap as well, we recommend using ionic cli instead: https://ionicframework.com/docs/cli/ (keep in mind that the app is developed using Ionic 3).
Re: How to set fixed site url?
Thanks for the response. I will try your provided repository.
But can you provide me a way to get the version of the moodle mobile app?
And please guide me how can I set the welcome page to directly go to the username and password page rather than asking me to fill the site url?
Thanks again.
Re: How to set fixed site url?
1. Now I am using the repository: https://github.com/moodlehq/moodleapp
2. I have setup the environment using this documentation: https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2
Re: How to set fixed site url?
All your changes to the app functionality should be made in the src folder.
For setting a static site url (and thereby going directly to the login screen) you have to edit the src\configconstants.ts file. More specificially you should enter you site url in:
Re: How to set fixed site url?
> PS. does anyone know what the purpose of config.json is, since changes here are not reflected, and since I managed to compile a perfectly working (except push notifications) customized app without touching src/config.json?
The config.json
file is the one you should be modifying, there is a gulp task that generates src/configconstants.ts
reading this json file. If you place your modifications in the typescript file you risk losing them, because that file is not tracked in the repository and it can be overwritten if some script regenerates it.
You can regenerate it yourself by calling the gulp task named config
, for example doing npx gulp
.
Re: How to set fixed site url?
I have added the URL to
static siteurl
in src/configconstants.ts
and it works fine. However, this is not a good practice as you mention, so I tried adding the URL to siteurl
in config.json
instead but it does not work. Am I adding the URL to
the wrong place? Thanks
Re: How to set fixed site url?
Make sure that you're running the gulp task again, to make sure you can call npx gulp
. Also, make sure that you're not adding "siteurl" twice in the json, because it should already be there.
Re: How to set fixed site url?
Thanks for your reply. I got this error:
[14:04:02] Starting 'default'...
[14:04:02] Starting 'lang'...
[14:04:02] Starting 'config'...
[14:04:02] 'config' errored after 380 ms
[13:57:09] SyntaxError: Unexpected token / in JSON at position 2301
at JSON.parse ()
at Stream. ([pathdodir]/gulp/task-build-config.js:62:41)
at Stream.stream.write ([pathdodir]/node_modules/through/index.js:26:11)
at DestroyableTransform.ondata ([pathdodir]/node_modules/readable-stream/lib/_stream_readable.js:619:20)
at DestroyableTransform.emit (events.js:311:20)
at DestroyableTransform.EventEmitter.emit (domain.js:505:15)
at addChunk ([pathdodir]/node_modules/readable-stream/lib/_stream_readable.js:291:12)
at readableAddChunk ([pathdodir]/node_modules/readable-stream/lib/_stream_readable.js:278:11)
at DestroyableTransform.Readable.push ([pathdodir]/node_modules/readable-stream/lib/_stream_readable.js:245:10)
at DestroyableTransform.Transform.push ([pathdodir]/node_modules/readable-stream/lib/_stream_transform.js:148:32)
[13:57:09] 'default' errored after 275 ms
[13:57:09] The following tasks did not complete: lang
[13:57:09] Did you forget to signal async completion?
(I've changed above the whole path to [pathdodir] to make the code cleaner)
Re: How to set fixed site url?
Thanks for your help......