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?
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
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:
> 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?
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
I have added the URL to
src/configconstants.tsand it works fine. However, this is not a good practice as you mention, so I tried adding the URL to
config.jsoninstead but it does not work. Am I adding the URL to the wrong place?
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.
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)
Thanks for your help......