Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-2938

Allow site plugins to specify it own URLs for the app and handle the contexturl field

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.6.1
    • Fix Version/s: 3.7.0
    • Component/s: Notifications add-on
    • Labels:
    • Testing Instructions:
      Hide

      This issue should be tested in Android and iOS.

      1. Add the file attached to this issue to a Moodle master site. Just copy it inside the root folder of the site.
      2. Edit the script and replace the value of "userto" to the ID of the user you'll use in the app.
      3. In web as admin, go to "Site administration > Messaging > Mobile" and configure the site to use push notifications.
      4. Install the app in the device and login with the user of the step 2.
      5. Go to "App settings > Notification preferences" and enable all toggles in the category "Inbound message configuration".
      6. In a browser, open the following URL: YOURSITE/test_push_appurl.php
      7. Check that you receive a push notification in the app.
      8. Click the notification. Check that the list of notifications is opened. Check that the first notification says "Test body. URL is NOT supported." and there is no "View" button.
      9. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=1
      10. Check that you receive a push notification in the app.
      11. Click the notification. Check that the list of your badges is opened.
      12. Go to notifications and perform a PTR if needed. Check that the first notification says "Test body. URL is supported. App URL set." and there is a "View" button.
      13. Click the "View" button. Check that your list of badges is opened.
      14. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=0
      15. Check that you receive a push notification in the app.
      16. Click the notification. Check that the list of notifications is opened.
      17. Perform a PTR if needed and check that the first notification says: "Test body. URL is NOT supported. App URL set.".
      18. Click the "View" button. Check that a browser is opened and displays your preferences page.
      19. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=0&supported=1&contexturl=1
      20. Check that you receive a push notification in the app.
      21. Click the notification. Check that the list of your badges is opened.
      22. Go to notifications and perform a PTR if needed. Check that the first notification says "Test body. URL is supported. Context URL set." and there is a "View" button.
      23. Click the "View" button. Check that your list of badges is opened.
      24. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=0&contexturl=1
      25. Check that you receive a push notification in the app.
      26. Click the notification. Check that the list of notifications is opened.
      27. Perform a PTR if needed and check that the first notification says: "Test body. URL is NOT supported. Context URL set. App URL set.".
      28. Click the "View" button. Check that a browser is opened and displays your preferences page.
      29. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=0&contexturl=1&supportedcontexturl=1
      30. Check that you receive a push notification in the app.
      31. Click the notification. Check that the list of your badges is opened.
      32. Go to notifications and perform a PTR if needed. Check that the first notification says "Test body. URL is supported in contexturl. Context URL set. App URL set." and there is a "View" button.
      33. Click the "View" button. Check that your list of badges is opened.
      Show
      This issue should be tested in Android and iOS. Add the file attached to this issue to a Moodle master site. Just copy it inside the root folder of the site. Edit the script and replace the value of "userto" to the ID of the user you'll use in the app. In web as admin, go to "Site administration > Messaging > Mobile" and configure the site to use push notifications. Install the app in the device and login with the user of the step 2. Go to "App settings > Notification preferences" and enable all toggles in the category "Inbound message configuration". In a browser, open the following URL: YOURSITE/test_push_appurl.php Check that you receive a push notification in the app. Click the notification. Check that the list of notifications is opened. Check that the first notification says "Test body. URL is NOT supported." and there is no "View" button. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=1 Check that you receive a push notification in the app. Click the notification. Check that the list of your badges is opened. Go to notifications and perform a PTR if needed. Check that the first notification says "Test body. URL is supported. App URL set." and there is a "View" button. Click the "View" button. Check that your list of badges is opened. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=0 Check that you receive a push notification in the app. Click the notification. Check that the list of notifications is opened. Perform a PTR if needed and check that the first notification says: "Test body. URL is NOT supported. App URL set.". Click the "View" button. Check that a browser is opened and displays your preferences page. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=0&supported=1&contexturl=1 Check that you receive a push notification in the app. Click the notification. Check that the list of your badges is opened. Go to notifications and perform a PTR if needed. Check that the first notification says "Test body. URL is supported. Context URL set." and there is a "View" button. Click the "View" button. Check that your list of badges is opened. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=0&contexturl=1 Check that you receive a push notification in the app. Click the notification. Check that the list of notifications is opened. Perform a PTR if needed and check that the first notification says: "Test body. URL is NOT supported. Context URL set. App URL set.". Click the "View" button. Check that a browser is opened and displays your preferences page. In a browser, open the following URL: YOURSITE/test_push_appurl.php?appurl=1&supported=0&contexturl=1&supportedcontexturl=1 Check that you receive a push notification in the app. Click the notification. Check that the list of your badges is opened. Go to notifications and perform a PTR if needed. Check that the first notification says "Test body. URL is supported in contexturl. Context URL set. App URL set." and there is a "View" button. Click the "View" button. Check that your list of badges is opened.
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Sprint:
      Moodle App 3.7.0

      Description

      Since Moodle 3.7 we'll have a new "customdata" structure coming with any notification.

      It will be good if site plugins can indicate via a field "appurl" a link that can be treated by the app so the user is correctly redirected to an app page when he clicks on a Push notification.

      Notifications already comes with a contexturl but most of the time won't work because the way the links are generated not always works in the app, so the approach will be:

      • Check if customdata->appurl is set and redirect when the user clicks on a Notification
      • If customdata->appurl is not set, try to redirect to the contexturl
      • If customdata->appurl is not set and there is not link handler for contexturl redirect to the standard Notifications page

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  7/Jun/19