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

Support push notification clicks for site plugins



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.6.1
    • Fix Version/s: None
    • Component/s: Push notifications
    • Labels:
    • Affected Branches:
    • Sprint:
      Moodle App 3.7.0


      Right now site plugins will only be able to create push click handlers by using plain JS. We could try to create a generic handler that tries to use the link handlers defined by the plugin, that way site plugins will be able to support push clicks just by creating the corresponding link handler for the contexturl.

      Also, there are a couple of problems when handling push clicks for site plugins:

      1. We only load the site plugins of the current site, so if you receive a push for another site stored in the app, that push won't be handled by the site plugins because they aren't loaded. The only way I can think of to handle this is:
        1. If the click belongs to another site, logout the user and login in the other site.
        2. Once logged in, wait for site plugins to be loaded (it can take a while).
        3. Once loaded, check if there is any push click handler to treat the notification. If there is none, open the Notifications page.
      1. If the push is clicked while the app is dead, it can take a while for site plugins to be loaded. We could be blocking the user for several seconds for nothing because maybe there is no site plugin to handle that link. I can't think of any way to solve this.

      I see two problems in the solution proposed for the point 1. The first one is that if there is a push click handler that doesn't display anything, it just does some action, we'll be redirecting the user to another site when there's no need to, but IMO it's a minor problem. The other problem is the same as point 2, we could be blocking the user for nothing but I can't think of any other way to do this.


          Issue Links



              dpalou Dani Palou
              dpalou Dani Palou
              Component watchers:
              0 Vote for this issue
              1 Start watching this issue