Debugging network requests in the Moodle App: Difference between revisions
Juan Leyva (talk | contribs) No edit summary |
Juan Leyva (talk | contribs) |
||
Line 44: | Line 44: | ||
Now, you are ready to debug all the Web Service requests done to your Moodle site by the Mobile app. | Now, you are ready to debug all the Web Service requests done to your Moodle site by the Mobile app. | ||
== | == Debugging a Web Service (WS) error == | ||
[[{{ns:file}}:moodlemobile_chrome_debug_ws_error.png|thumb|300px]] | [[{{ns:file}}:moodlemobile_chrome_debug_ws_error.png|thumb|300px]] | ||
Line 50: | Line 50: | ||
# Connect to your site and browse to the functionality returning an error | # Connect to your site and browse to the functionality returning an error | ||
# In your right Window you will see a list of requests done by the app to your Moodle site (token.php server.php server.php etc..) | # In your right Window you will see a list of requests done by the app to your Moodle site (token.php server.php server.php etc..) | ||
# Click on each one of them (starting by the last one in the list) but skipping those that | # Click on each one of them (starting by the last one in the list) but skipping those that don’t start with token.php or server.php | ||
# In the new sub-window open select the “Response” tab and check if you see an error | # In the new sub-window open select the “Response” tab and check if you see an error | ||
# Copy the error and go to the Moodle FAQ to see if there is a known solution for it | # Copy the error and go to the Moodle FAQ to see if there is a known solution for it |
Revision as of 12:07, 11 December 2017
Introduction
This guide will teach you how to find and report problems that may be causing the Mobile app not to work on your site.
This guide is specially useful for the following problems:
- When you are not able to log-in on your site.
- When you receive one of the following error messages in the app:
- Can not find data record in database table external_functions
- Invalid response value detected
- Cannot get course contents
Requeriments
- Moodle 3.0 onwards (your site needs at least this version)
- Google Chrome browser
Enabling debugging on your Moodle site
The first thing we need to do is enabling debugging on your Moodle site.
- Go to Site Administration > Development > Debugging
- Chosse "DEVELOPER: .." option in "Debug messages"
- Check "Display debug messages"
Please, remember to disable Debugging on your site (setting "Debug messages" to NONE) once you've finished debugging your problem.
Setting up Chrome
Debugging a Mobile app is not easy at all, this is why we have published and online web version of the app that could be easily debuggable just using the Chrome browser.
- Open your Chrome Browser and visit the following URL: https://prototype.moodle.net/mobile/webapp/
- Now, open your browser options (icon at the top-right of your browser Window)
- Go to More tools -> Developer tools
- Dock the new Windows to the right side (in the new window top-right options choose “Dock to the right” icon)
- Select the Network tab (at the top-center)
- Enable the filter (filter shape icon) so it changes to color red
- In the new text field displayed when enabling the filter write “.php” without the “”
Now, you are ready to debug all the Web Service requests done to your Moodle site by the Mobile app.
Debugging a Web Service (WS) error
- Connect to your site and browse to the functionality returning an error
- In your right Window you will see a list of requests done by the app to your Moodle site (token.php server.php server.php etc..)
- Click on each one of them (starting by the last one in the list) but skipping those that don’t start with token.php or server.php
- In the new sub-window open select the “Response” tab and check if you see an error
- Copy the error and go to the Moodle FAQ to see if there is a known solution for it
- If you are unable to find a solution, post in the moodle for mobile forum the error