Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:Setting up your development environment for Moodle Mobile 2 (Ionic 1)

From MoodleDocs
Revision as of 20:04, 5 April 2018 by Helen Foster (talk | contribs) (Tsala moved page Talk:Setting up your development environment for Moodle Mobile 2 to Talk:Setting up your development environment for Moodle Mobile 2 (Ionic 1) without leaving a redirect: obsolete docs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

If you're running the ionic server on a different IP address to the Moodle system you're connecting the app to, then you'll find some elements of MoodleMobile are blocked by Cross-site scripting restrictions in Chromium/Chrome. To fix this you'll need to add the following to the apache config for the relevant virtual host:

Header set Access-Control-Allow-Origin "*"

Note, the above is not recommended for production systems, only do this for restricted access development sites.

Then you need to install the "Allow-Control-Allow-Origin" (CORS) extension for Chrome/Chromium. Once the extension is installed, access it's settings page and enable "Cross-origin resource sharing". On my test set up the download of remote addons was blocked until I made these changes, there were also other errors in the console relating to cross site scripting, but I didn't investigate the impact of these errors and they went away after the above changes were made.