javascript - cannot get chat dialogs with backend authonticatioin "Forbidden. Need user." errror -
i using js sdk quickblox. create session on backend server:
https://api.quickblox.com/session.json token result in js
qb.init(token, apiid); qb.getsession(function(err, res) { qb.chat.connect({userid: user.id, password: user.pass}, function(err, roster) { qb.chat.dialog.list(null, function(err, resdialogs) {}); }); });
and have "forbidden. need user" error. thinking b.chat.connect should set current user, seems wrong.
i added db.login , works right now.
qb.login({login: user.login, password: user.pass}, function(err, res) { qb.getsession(function (err, res) { qb.chat.connect({userid: user.id, password: user.pass}, function (err, roster) { qb.chat.dialog.list(null, function (err, resdialogs) { }); }); }); });
Comments
Post a Comment