android - QuickBlox Token is required error -


i have been using code examples quickblox website getting following error:

signin error: token required 

my code:

qbsettings.getinstance().fastconfiginit(app_id, auth_key, auth_sec);     qbauth.createsession("test", "test",new qbcallbackimpl() {         @override         public void oncomplete(result result) {             if (result.issuccess()) {                 // result comes here if authorization success                 log.d(tag,"createsession success");                 qbsessionresult qbsessionresult = (qbsessionresult) result;             }else{                 for(string s: result.geterrors()){                     log.d(tag, "createsession error: " +s);                 }             }         }         });               //getting error in here      qbusers.signin("test","test", new qbcallbackimpl() {                     @override                     public void oncomplete(result result) {                         if (result.issuccess()) {                             log.d(tag,"signin success");                             qbuserresult qbuserresult = (qbuserresult) result;                         } else {                             for(string s: result.geterrors()){                                 log.d(tag, "signin error: " +s);                             }                         }                     }                 }); 

the session created succcessfully , user "test" exists password "test" on quickblox dashboard under application.

please advise doing wrong?

you have call qbusers.signin after session creation

    qbsettings.getinstance().fastconfiginit(app_id, auth_key, auth_sec);     qbauth.createsession("test", "test",new qbcallbackimpl() {         @override         public void oncomplete(result result) {             if (result.issuccess()) {                  qbusers.signin("test","test", new qbcallbackimpl() {                     @override                     public void oncomplete(result result) {                         if (result.issuccess()) {                             log.d(tag,"signin success");                             qbuserresult qbuserresult = (qbuserresult) result;                         } else {                             for(string s: result.geterrors()){                                 log.d(tag, "signin error: " +s);                             }                         }                     }                 });               }else{                 for(string s: result.geterrors()){                     log.d(tag, "createsession error: " +s);                 }             }         }         }); 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -