Get "Forbidden. Need user" when request messagesWithDialogID

566 Views Asked by At

I get the same response every time I request history messages from Quickblock.

I already search for some topics in here, and they say I'm not logged in or I don't have permission to do that. I'm pretty sure I'm logged in and I have a permission. Everything works fine I can send, receive message but I can't get the history.

Here is the code

[QBRequest messagesWithDialogID:myId extendedRequest:nil forPage:resPage successBlock:^(QBResponse *response, NSArray *messages, QBResponsePage *responcePage) {



    } errorBlock:^(QBResponse *response) {
        NSLog(@"error: %@", response.error);
    }];
1

There are 1 best solutions below

1
On

You have to be logged in as a user in order to request your messages

Read this guide about session creation

http://quickblox.com/developers/SimpleSample-chat_users-ios#Login_to_Chat

You can do [QBRequest createSession...] or [QBRequest logIn...]