0

I am using the built in function provided by Quickblox - chatService.listRooms(function(err,result))

When I execute this function - I get just true in the result. When I go to the Console and see the response, it is this -

enter image description here

So, actually it is fetching the list but not returning in the form of XML/JSON to the function?

How to do this? Thanks!

01egyk
  • 506
  • 4
  • 10
Lakshay Dulani
  • 1,710
  • 2
  • 18
  • 45

2 Answers2

1

Update your chat plugin to version 0.9.0

http://quickblox.com/developers/Web_XMPP_Chat_Sample#Download_Chat_plugin

In new version this was changed. Currently, next functions give the array with objects in response:

  • getRoomMembers
  • getOnlineUsers
  • listRooms
  • getRoomInfo
Rubycon
  • 18,156
  • 10
  • 49
  • 70
WebDev
  • 256
  • 1
  • 3
  • thanks a lot!... i was fiddling on the sample i downloaded from their site.. so i assumed it was using the latest plugin.. interestingly, the response i got from QB tells me that they are still working on this..anyways thanks again..cheers! – Lakshay Dulani Jun 16 '14 at 05:55
0

Where did you find this method? chatService.listRooms(function(err,result))

If you use Android SDK - there is another method to retrieve a list of all rooms:

http://quickblox.com/developers/Android_XMPP_Chat_Sample#Retrieving_rooms

QBChatService.getInstance().getRooms(new RoomReceivingListener() {
    @Override
    public void onReceiveRooms(List<QBChatRoom> qbChatRooms) {
        for (QBChatRoom room : qbChatRooms) {
            Log.d(TAG, "Received room " + room.getName());
        }
    }
});

And it works as expected

Same for iOS:

[[QBChat instance] requestAllRooms];

- (void)chatDidReceiveListOfRooms:(NSArray *)_rooms{
    NSLog(@"Did receive list of rooms: %@", _rooms);
}

Please provide a bit more info what programming language and SDK do you use

Rubycon
  • 18,156
  • 10
  • 49
  • 70