Support for course activities

Re: Support for course activities

by Anthony Durif -
Number of replies: 0
Picture of Plugin developers
Hello Dani,

Thanks for the answer (and sorry for my late answer to yours).
In my plugin I used to use Guzzle to easily call functions which were in another library I added thanks to a local composer file. I have no problem in my browser and the plugin works well but when I tried to test it on the moodle mobile app I encounted the error (probably because of what you say about the app who doesn't include any external lib installed in Moodle).

For that I edited my plugin to have two different behiavours in function of if we call it classicly (web, browser) or if we call it via the mobile app. In this case I do not use guzzle and my other library and I do some curl directly on the API. It is a little more complicated because I cannot use existant functions of my library but I think I managed to do what I needed.

For information I test the source by using this:
if (WS_SERVER) {
    // Curl calls.
} else {
    // Guzzle calls.
}