Preset login url for app

Svar: Preset login url for app

by Patrik Lindqvist -
Number of replies: 5
Hi Juan

Im so confused... i have been doing research and there is no information

regarding the information you just emailed me.

The information on moodle recommends changing the files in github and

then rebuild in phonegap. Im so tired right now, 5 days of doing the

wrong thing and now im just confused and dont understand a thing.

What does running gulp or ionic serve... there is no inforamtion on this

either?

Maybe i shoud just quit.

Regards, Patrik
In reply to Patrik Lindqvist

Re: Svar: Preset login url for app

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

Hello Patrik,

in this section you have the steps required to move the changes from the moodlemobile2 repository to the phonegapbuild repository. It is the recommended way because it's easier to maintain the code, but it's harder to setup the development environment.

If the only thing you want to do is to preset the URL you can just modify the phonegapbuild repository as you were doing. All our documentation takes into account that you are modifying the moodlemobile2 repository (recommended way), that's why doing exactly the same in the phonegapbuild repo might not work.

In short, to preset the URL in the phonegapbuild repository you need to modify the file:

build/mm.bundle.js

In there, search for this line:

    .constant('mmCoreConfigConstants', {

Shortly after this line you will see a line like this:

    "siteurl": "",

You should set the URL in there.

Kind regards,

Dani

In reply to Dani Palou

Re: Svar: Preset login url for app

by Nrsinga Dasa -

Hello Dani

I have a question... I am new to this.  I have followed all the instructions and updated the git repository manually.  The App works besides the URL issue. I have updated siteurl accordingly.

I have not used gulp or ionic serve. Will this make any difference?  When it talks about (Then run gulp or ionic serve in the project root folder so the build files are created) does this create additional files that is needed?

Regards

Naresh


In reply to Nrsinga Dasa

Re: Svar: Preset login url for app

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

If you use the moodlemobile2 repository then you need to run gulp to make it work.

If you use the moodlemobile-phonegapbuild repository then you don't need to run gulp, but all the changes must be applied to build/mm.bundle.js.

Kind regards,

Dani

In reply to Dani Palou

Re: Svar: Preset login url for app

by Nrsinga Dasa -

Perfect thanks for the clarification. Should I ignore the bold statement below?


Building with Phonegap Build

GitHub

  • First of all, you need to create a new repository in GitHub. This is because Phonegap Build requires a different directory structure than Ionic CLI and we need a branch per platform.
  • In your forked repository, run gulp so the build files are updated.
 

Now i just need to figure why the URL is not accepted when I have updated mm.bundle.js.

Am I correct that we don't need to fork moodlemobile2 repository,  if we using moodlemobile-phonegapbuild repository with the appropriate branches? 

In reply to Nrsinga Dasa

Re: Svar: Preset login url for app

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

Yes, you can ignore the bold statement. That's only needed if you use the moodlemobile2 repository. We run gulp in moodlemobile2 repository, and then we copy the build files to the moodlemobile-phonegapbuild repository. Since you're already modifying the final files you don't need to do that.

So yeah, there's no need to fork the moodlemobile2 repository.

Cheers,

Dani