mobile addon for local plugin

Re: mobile addon for local plugin

by Jean-Roch Meurisse -
Number of replies: 9
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi,

Finally, mod_certificate indeed works on android, but still not in chrome with a local install of mobile app and remote addon.

You'll find attached my module including the packaged remote addon. It's based on the calendar addon and was made very quickly so there is still unused code...

Thanks in advance for your help

Jean-Roch

In reply to Jean-Roch Meurisse

Re: mobile addon for local plugin

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

Hi Jean-Roch,

sorry for the delay in answering. There was a bug in our gulpfile:

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

That bug was fixed some weeks ago. I checked your addon and it's failing because it includes the testing code.

Please update your moodlemobile2 master branch and package the addon again. Let me know if that fixes it for you smile

Kind regards,

Dani

In reply to Dani Palou

Re: mobile addon for local plugin

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi Dani,

First of all, thanks a lot for your help! It's now working with the official Mobile app.

Unfortunately, when rebuilding the app locally using a clean fork of the app (I only changed the widget id, name and description, and added nothing else), the remote addon doesn't show, neither in a browser with ionic serve or in android/ios device.

Any hint?

Kind regards

Jean-Roch 

In reply to Jean-Roch Meurisse

Re: mobile addon for local plugin

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

Hi Jean-Roch,

that's weird. Did you check that there are no errors shown in the Javascript console?

Also, if you're building the APK using phonegap CLI make sure you have all the cordova plugins installed in your development environment. The list of plugins used by the app can be seen in this config.xml file:

https://github.com/moodlehq/moodlemobile-phonegapbuild/blob/master/config.xml#L112

Kind regards,

Dani

In reply to Dani Palou

Re: mobile addon for local plugin

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hey Dani,

I tried with mod_certificate too and experienced the same problem.

See console screen capture attached

This is a very well known security error with xmlhttprequest, but I can't figure out how to solve this here since the .zip package is generated from the mobile dev environment

I got the same error with mobile.css file and image core/u/f1 and a bunch or errors like the following

22/12/2016 08:59:39 $mmSite: WS function 'tool_mobile_get_config' is not available, even in compatibility mode.

Thanks again for your help

Jean-Roch

Attachment Capture d’écran 2016-12-22 à 09.21.35.png
In reply to Dani Palou

Re: mobile addon for local plugin

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hey again, 

There were missing cordova plugins... After fixing that and rebuilding the app, it is functional on an ios device but still missing remote addons when served in either Chromium or Google Chrome (same errors as in my previous post).

Kind regards

Jean-Roch

In reply to Jean-Roch Meurisse

Re: mobile addon for local plugin

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

Hi again,

I'm glad it works in iOS. To fix the CORS errors in Chrome or Chromium you need to use some flags when opening the browser. It is explained in here:

https://docs.moodle.org/dev/Moodle_Mobile_development_using_Chrome_or_Chromium#Installation

Kind regards,

Dani

In reply to Dani Palou

Re: mobile addon for local plugin

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers

Great! What a Christmas present wink

Thanks a lot, remote addons correctly show now smile so as far as I know everything works 

I didn't do that since de doc says it's not necessary any more from moodle 3.0

However I still have a bunch of 

    function 'tool_mobile_get_config' is not available, even in compatibility mode

I don't know whether it's important or not.

Thanks a lot again

Jean-Roch

In reply to Jean-Roch Meurisse

Re: mobile addon for local plugin

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

Hi Jean-Roch,

I'm glad it works now!

tool_mobile_get_config is a WebService that was introduced in Moodle 3.2. Since your Moodle site is previous to 3.2, the WS is not available.

This WS is used to fix this bug:

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

And it's also used to show the grades for all course (this feature also requires gradereport_overview_get_course_grades, another WS introduced in Moodle 3.2).

So it's not mandatory for the app to work fine, don't worry about that.

Kind regards,

Dani

In reply to Dani Palou

Re: mobile addon for local plugin

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers

Thanks for all Dani,

It's very stimulating to get so quick and efficient support!

Merry Christmas

Jean-Roch