quickblox

Unable to connect to chat


Here is a part of log:

[13/03 00:06:20] createSessionWithBlock:: [QBUUser]: ID:88650 created at:2019-03-07 14:36:56 +0000 updated at:2019-03-11 02:55:21 +0000 externalUserID:0 blobID:0 facebookID:(null) twitterID:(null) twitterDigitsID:(null) full name:(null) email:(null) login:facebook/10639610917659520 phone:(null) tags:(null) lastRequestAt:2019-03-12 02:55:23 +0000 customData:(null) website:(null) password:f99df247d9ddfc36b949ff71c6fdf44f69ced79057

Got successfully authorized and connected to QB. Was able to communicate, connect and disconnect to/from the server, no errors were received. But an error from chat came up.

[13/03 10:59:32] Error Domain=com.xxxxxx.error.serialization.response Code=-1011 "Request failed: forbidden (403)" UserInfo={com.xxxxxx.serialization.response.error.response=

{ URL: https://apixxxxx.quickblox.com/chat/Dialog/567271d456327456a4689327json }

...NSErrorFailingURLKey=https://apixxx.quickblox.com/chat/Dialog/5634571d67277358a800bb27.json, NSLocalizedRecoverySuggestion=

{"errors":["You don't have appropriate permissions to perform this operation"]}

com.xxxx.serialization.response.error.data=<7b336572 726f7243 223a5b43 596f7512 646f6e27 74204561 76652061 7070726f 70726961 74652070 65726d69 7373696f 6e732074 6f207065 72666f72 6d207468 6973206f 70657261 74696f6e 225d7d>, NSLocalizedDescription=Request failed: forbidden (403)}---1011
  1. Why did this error occur, how come I wasn't able to connect to the chat?
  2. What might be the reasons of such errors to happen?
  3. What it needs to be undertaken to not receive such errors anymore?
  4. What should I do if the error is received.

Solution

  • Welcome to Stackoverflow and thank you for your interest in Quickblox platform!

    1. The reason is that user ID 88650 is missing from the occupants_ids list.
    2. There are two cases, a user is missing from the occupants_ids list or a user from the list deleted the dialog itself.
    3. In order to avoid such errors you should make API calls to get the messages only to dialogs where the user participates in (is within occupants_ids list).
    4. You need to add the user to occupants_ids list.