Quickblox: Custom Module - Custom callback function instead of default 'completedWithResult' -
when using 'custom module', there times when multiple asynchronous requests happen @ same time (handled same delegate) , there need distinguish request triggered 'completedwithresult' callback.
is there way provide custom callback function particular request? if not, best way distinguish between multiple requests inside 'completedwithresult'callback?
you should use context
[qbusers loginwithuserlogin:@"injoituser1" password:@"injoituser1" delegate:self context:@"thisispoint1"]; [qbusers loginwithuserlogin:@"injoituser1" password:@"injoituser1" delegate:self context:@"thisispoint2"]; - (void)completedwithresult:(result *)result context:(void *)contextinfo{ if([result iskindofclass:qbuuserloginresult.class]){ if(result.success){ if([((nsstring *)contextinfo) isequaltostring:@"thisispoint1"]){ // smthn } } }
Comments
Post a Comment