Real-time notifications and messages in Moodle webapplication?

Real-time notifications and messages in Moodle webapplication?

by Preben Pedersen -
Number of replies: 4

Hello everyone.

I'm sorry if i'm posting in the wrong forum.


Moodles instant messaging (and notifications) icons in the top menu of the webapplication, only seems to update when the page is refrshed or changed.

I would like to know if it is somehow possible to make it update in real-time, and not only upon refresh?


When i search for it, i only get results regarding the Mobile app.

Average of ratings: -
In reply to Preben Pedersen

Ang: Real-time notifications and messages in Moodle webapplication?

by Preben Pedersen -

An end-of-day update.

I have tried to make a script to upgrade the messages and notification every third second with this:

 define(['jquery'])


 setInterval(realtime_absalon_update, 3000);

 function realtime_absalon_update() {

   var request = {

     methodname: 'core_message_get_unread_conversations_count',

     args: args

   };

   var promise = Ajax.call([request])[0];

   alert(promise)

 };


It won't work though, it says 'args is not defined'. 
I tried to sort that by loading the javascript from core, but it won't load it with this:

require([core_message/message_repository]);


If anyone got any ideas, then i really appreciate it.

In reply to Preben Pedersen

Re: Ang: Real-time notifications and messages in Moodle webapplication?

by griffin tucker -

i'm just posting to let you know i'd also like this feature, but i can't help with the code unfortunately

In reply to Preben Pedersen

Re: Real-time notifications and messages in Moodle webapplication?

by Yana Konstantinovsky -

Hi Preben, 


Were you able to find a solution for this? 

In reply to Yana Konstantinovsky

Ang: Re: Real-time notifications and messages in Moodle webapplication?

by Preben Pedersen -
I have not.

But in my opinion Moodle needs this feature, so hopefully it will happen some day.