Customizing push notifications for data exchange

Customizing push notifications for data exchange

by Zoran Jeremic -
Number of replies: 3
Hi,

I'm developing Mobile app add on that communicates with custom local plugin in Moodle 2.6. One scenario of use I need to cover is to provide some personalized interventions based on certain user action. For example, when user visit some page, several sub-plugins in the Moodle web application will be triggered, and some of them might provide certain intervention such as warning, recommendation, etc.
The problem is in that these sub-plugins are to be developed based on machine learning algorithms, and sometimes it might take some time for processing, so user might have a warning produced immediately, and recommendation might be produced 30 seconds later, or he might have no intervention.
I thought that pushing this interventions from Moodle web application to Mobile device might  be more efficient then having a poll that will check in frequent intervals if there is some intervention for user to be displayed. At least, there will be no delays in providing feedback.
However, I've never used push notifications and I'm not sure if it could be used in this way, and if it is the best solution for my scenario. The other thing is that I don't want users to have to enable push notifications in order to make it work. It should always work.


I would appreciate any advice on this issue.

Thanks,

Zoran

Average of ratings: -
In reply to Zoran Jeremic

Re: Customizing push notifications for data exchange

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

I'd recommend you to do that via message outputs https://docs.moodle.org/dev/Messaging_2.0 that they are connected with Mobile notifications right now.

The only problem I see is that you want everything automatically enabled, in that case, I'd suggest you to create a new external function (Web Service) to be called by the Mobile application (for example, listening the SiteUpdate event https://docs.moodle.org/dev/Moodle_Mobile#Events) to force the user messaging profile settings for the Mobile notifications output system to be on

Another potential issue is that you will need your own Airnotifier server if you want the app to work on iOs too.

Juan

In reply to Juan Leyva

Re: Customizing push notifications for data exchange

by Zoran Jeremic -
Another potential issue is that you will need your own Airnotifier server if you want the app to work on iOs too.

Can you clarify this, please? I'm not sure if I understood it well. I found in several posts that you need Airnotifier server for iOS only. My understanding is that I need Airnotifier for Android too, but I can use Moodle public Airnotifier server. Since I'm developing custom application locally, and don't have Moodle domain that I can register on Moodle.org, I will need my own Airnotifier server for Android too.

Is that correct, or I missed something?

In reply to Zoran Jeremic

Re: Customizing push notifications for data exchange

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Zoran,

to clarify:

  • If you have developed an app for Android only, you can use the public Airnotifier installation after registering your site (you can also use a custom installation too).
  • If you have developed an app for both Android and iOs (or only iOs) you will need to use a custom Airnotifier installation.

====================================================================

The technical reason is that for iOs you need to create certificates linked to your custom app, but for Android you use a generic API key (so you can use the same API key in different apps)

Regards, Juan

Average of ratings: Useful (1)