Real-time notifications and messages in Moodle webapplication?

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

by Preben Pedersen -
Number of replies: 1

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