Search code examples
messagingmesibo

How to get all messages of a particular user or group in mesibo using plain javascript


The Documentation provides examples for android and IOS but not for JS. We also looked at the demo projects, but they are in angular. how do we do it in plain JS

I wrote this by imitating the Android example and Angular example

   api.readDbSession(null, '96042', null, function on_message(m) {
        console.log('m is ', m);
        console.log('m.read is ', m.read(100))
    });

But the above results in m is null


Solution

  • Have you checked code on GitHub

    var session = api.readDbSession(null, '96042', null, function on_message(m) {
            console.log('m is ', session.messages);
            console.log('m is ', session.getMessages());
        });
        session.read(100);