General developer forum

Mobile app based on other module.

 
Picture of Takeshi Matsuzaki
Mobile app based on other module.
 

Hello, friends.

I have tried to make my module for mobile app. I don't want to rewrite a mobile app. So that the first of all, I thought to use mod_page for the base of my module to use page's external function. So that I changed the name of 'page' to 'mymod' and changed services.php below. The new module can work on PC, but external link was shown on the smart phone.

What did I miss or make an easy mistake ?

$functions = array(

    'mod_mymod_view_mymod' => array(

        'classname'     => 'mod_page_external',

        'methodname'    => 'view_page',

        'description'   => 'Simulate the view.php web interface mymod: trigger events, completion, etc...',

        'type'          => 'write',

        'capabilities'  => 'mod/page:view',

        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)

    ),

    'mod_mymod_get_mymods_by_courses' => array(

        'classname'     => 'mod_page_external',

        'methodname'    =>  'get_pages_by_courses'

        'description'   => 'Returns a list of mymods in a provided list of courses, if no list is provided all mymods that the user

                            can view will be returned.',

        'type'          => 'read',

        'capabilities'  => 'mod/page:view', 

        'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE),

    ),

);


 
Average of ratings: -
Davo
Re: Mobile app based on other module.
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

From my understanding, you'll need a plugin for Moodle Mobile in order to show your custom plugin natively. I suggest you read through: https://docs.moodle.org/dev/Moodle_Mobile_Developing_a_plugin_tutorial and https://docs.moodle.org/dev/Moodle_Mobile_Remote_add-ons

(Note - I've never done this myself, so there may be others who can offer better starting advice).

 
Average of ratings: -
Picture of Takeshi Matsuzaki
Re: Mobile app based on other module.
 

Hello, Davo.

Thank you for the information.

In fact, I don't write so many new angular codes that I hope to reuse the services already exists. 

 
Average of ratings: -