MM2 problem: $mmSite: WS function is not available even in compatibility mode

MM2 problem: $mmSite: WS function is not available even in compatibility mode

by Zoran Jeremic -
Number of replies: 4

Hi guys,


I've implemented web service in my local plugin, and it seems to be available from the Moodle:

external service

functions

However, when I try  to access from Moodle mobile 2 using the following code:


            var data = {
courseid : courseId
},
presets = {};
$mmSite.read('local_morph_is_morph_activated', data, presets);

I get an error message indicating that it's not available:

    05/08/2015, 15:17:24 $mmSite: WS function 'local_morph_is_morph_activated' is not available, even in compatibility mode

Is there anything else that I might missed to check about this service?


Thanks,

Zoran


Average of ratings: -
In reply to Zoran Jeremic

Re: MM2 problem: $mmSite: WS function is not available even in compatibility mode

by Zoran Jeremic -

I was able to narrow down the problem, but not to solve it yet. I just copy/pasted service function description from my plugin implementation/local/morph/db/services.php into local/mobile/db/services.php and it started to work fine. However, I want to implement everything in my plugin, and not to customize local_mobile plugin.

I guess I missed something that is necessary, but from documentation I found online, I didn't find anything else to be required except externallib.php and services.php.

Did I miss something?

Thanks,

Zoran

In reply to Zoran Jeremic

Re: MM2 problem: $mmSite: WS function is not available even in compatibility mode

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

Hello Zoran,

unfortunately the app only works with Moodle Mobile default service or with "Moodle Mobile additional features" service. Right now the only way to make it work with a custom service would be to create a custom app pointing to your service. So right now there's no other way than customizing the default services sad

I raised an issue for this:

https://tracker.moodle.org/browse/MOBILE-1150

Regards,

Dani

Average of ratings: Useful (1)
In reply to Dani Palou

Re: MM2 problem: $mmSite: WS function is not available even in compatibility mode

by Zoran Jeremic -

Hi Daniel,

Thank you for explaining this and creating issue. I think that should be supported. Whoever develop custom addons for mobile application, most likely would need to develop his own services to support it. I personally hate idea to hack moodle core code or plugins that are not mine and add services there. I might live with at the moment since I'm still in development phase, but once I'm close to the delivery, I would be very happy to have this feature.


Thanks,

Zoran