Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-56044

New Web Service message_airnotifier_get_user_devices

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.2
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide
      1. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      2. Create a Token in the mobile app service for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      3. Then configure the message output plugin "Mobile notifiations": you just need to enter a valid API key (please, use the one in the comment bellow), and then you must enable it in the list of message output plugins available
      4. Once is configured, with your mobile device, open the Moodle Mobile app and log in to the site
      5. Now, go to your messaging preferences in Moodle web (/message/edit.php?id=USER_ID) and check that your device is listed in the Mobile notifications section
      6. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'appid=com.moodle.moodlemobile&wsfunction=message_airnotifier_get_user_devices&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool"

      7. Check that your device is correctly listed
      8. In the messaging preferences option in Moodle web, hide your device (click in the eye)
      9. Execute the curl request again and check that the enable field is set to 0 for the device
      Show
      As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token in the mobile app service for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Then configure the message output plugin "Mobile notifiations": you just need to enter a valid API key (please, use the one in the comment bellow), and then you must enable it in the list of message output plugins available Once is configured, with your mobile device, open the Moodle Mobile app and log in to the site Now, go to your messaging preferences in Moodle web (/message/edit.php?id=USER_ID) and check that your device is listed in the Mobile notifications section Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'appid=com.moodle.moodlemobile&wsfunction=message_airnotifier_get_user_devices&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool" Check that your device is correctly listed In the messaging preferences option in Moodle web, hide your device (click in the eye) Execute the curl request again and check that the enable field is set to 0 for the device
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-56044-master

      Description

      Return the list of mobile devices that are registered in Moodle for the given user.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16