QuickBlox / quickblox-ios-sdk

QuickBlox iOS SDK for messaging and video calling
https://quickblox.com/developers/IOS
MIT License
397 stars 358 forks source link

Sometimes dialog name not show in dialog list. #1042

Closed riteshpatel0 closed 4 years ago

riteshpatel0 commented 6 years ago

Hello,

we are not getting dialog name in dialog list(chat user list). and sometime we are getting same dialog for multiple times. so we have problem to show dialog in list.

Thanks.

ghost commented 6 years ago

Hi @riteshpatel0, Could you please provide full logs with this issue?

riteshpatel0 commented 6 years ago

Hello @pro100andrey , Sometime we are not getting dialog name and different image of dialog. we don't know which image is come.

when selecting the dialog we are perform below code,

let qbuser = QBUUser()
        qbuser.id = UInt(user.chat_user_id!)
        qbuser.fullName = user.firstName+" "+user.lastName
        qbuser.login = user.email
        ServicesManager.instance().currentDialogID = String(user.chat_user_id!)
        ServicesManager.instance().usersService.usersMemoryStorage.add([qbuser])
        ServicesManager.instance().chatService.createPrivateChatDialog(withOpponent: qbuser, completion: { (response, chatDialog) in
            if chatDialog != nil {
                self.dialog = chatDialog
                self.performSegue(withIdentifier: "showChatController", sender: sender.tag)
            }
        })

Response/Log:

headers: {
    "Accept-Language" = "en;q=1";
    "QB-OS" = "iOS 11.3";
    "QB-SDK" = "iOS 2.15";
    "QB-Token" = 32890c61f8276858f80338fcfa08bce79f01149f;
    "QuickBlox-REST-API-Version" = "0.1.1";
    "User-Agent" = "HelpMeOut/1.0 (iPhone; iOS 11.3; Scale/3.00)";
}
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-05-29 17:14:01.311110+0530 HelpMeOut[19793:272875] [ChatService]: SNT: <iq type="get" id="3CD7F094-B7CD-4836-8208-AE54794855C9">
  <query xmlns="jabber:iq:privacy">
    <list name="PrivateList"/>
  </query>
</iq>
2018-05-29 17:14:01:546 HelpMeOut[19793:1306b] RECV: <iq xmlns="jabber:client" to="50193652-70815@chat.quickblox.com/7DF2151A-A4FF-477F-A76F-8D216A643F18" id="3CD7F094-B7CD-4836-8208-AE54794855C9" type="error"><query xmlns="jabber:iq:privacy"><list name="PrivateList"/></query><error type="cancel" code="404"><item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" lang="en">Requested list not found.</text></error></iq>
2018-05-29 17:14:01.546964+0530 HelpMeOut[19793:272688] [ChatService]: RCV: <iq xmlns="jabber:client" to="50193652-70815@chat.quickblox.com/7DF2151A-A4FF-477F-A76F-8D216A643F18" id="3CD7F094-B7CD-4836-8208-AE54794855C9" type="error">
  <query xmlns="jabber:iq:privacy">
    <list name="PrivateList"/>
  </query>
  <error type="cancel" code="404">
    <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" lang="en">Requested list not found.</text>
  </error>
</iq>
2018-05-29 17:14:01.568063+0530 HelpMeOut[19793:272875] [QBCore]: Response[61]:
headers: {
    "Access-Control-Allow-Origin" = "*";
    "Cache-Control" = "max-age=0, private, must-revalidate";
    Connection = "keep-alive";
    "Content-Length" = 475;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Tue, 29 May 2018 11:44:01 GMT";
    Duration = "0.281519";
    Etag = "W/\"e6aefb48d94b34a71a7fdad168d57044\"";
    "QB-Token-ExpirationDate" = "2018-05-29 13:39:35 +0000";
    "QuickBlox-REST-API-Version" = "0.1.1";
    Server = "openresty/1.9.15.1";
    "Set-Cookie" = "_mkra_ctxt=678cb4110d3d01930236cf6c299fce44--200; path=/; max-age=5; HttpOnly; secure";
    Status = "304 Not Modified";
    "Strict-Transport-Security" = "max-age=31536000, max-age=15768000;";
    "X-Content-Type-Options" = nosniff;
    "X-Frame-Options" = SAMEORIGIN;
    "X-Request-Id" = "0f375967-8024-4d2d-98f9-00e84964e139";
    "X-Runtime" = "0.021120";
    "X-XSS-Protection" = "1; mode=block";
}
object: {
    user =     {
        "blob_id" = "<null>";
        "created_at" = "2018-05-18T08:57:51Z";
        "custom_data" = "{\"avatar_url\":\"https://staging.zealousys.com/uRelate/wp-content/uploads/2018/05/1527145159_1461527145159_146.jpeg\"}";
        email = "thanos@gmail.com";
        "external_user_id" = "<null>";
        "facebook_id" = "<null>";
        "full_name" = "Thanos Stark";
        id = 50194435;
        "last_request_at" = "2018-05-29T10:15:50Z";
        login = "thanos@gmail.com";
        phone = "<null>";
        "twitter_id" = "<null>";
        "updated_at" = "2018-05-29T10:15:50Z";
        "user_tags" = "<null>";
        website = "<null>";
    };
}
2018-05-29 17:14:01:800 HelpMeOut[19793:1306b] RECV: <r xmlns="urn:xmpp:sm:3"/>
2018-05-29 17:14:01:801 HelpMeOut[19793:e367] SEND: <a xmlns="urn:xmpp:sm:3" h="17"/>
Optional("5b064a2da0eb476abdedeecb")
2018-05-29 17:14:01.813273+0530 HelpMeOut[19793:272875] [QBCore]: Request[62]:
GET URL:https://api.quickblox.com/chat/Message.json?chat_dialog_id=5b064a2da0eb476abdedeecb&limit=25&sort_desc=date_sent
headers: {
    "Accept-Language" = "en;q=1";
    "QB-OS" = "iOS 11.3";
    "QB-SDK" = "iOS 2.15";
    "QB-Token" = 32890c61f8276858f80338fcfa08bce79f01149f;
    "QuickBlox-REST-API-Version" = "0.1.1";
    "User-Agent" = "HelpMeOut/1.0 (iPhone; iOS 11.3; Scale/3.00)";
}
parameters: {
    "chat_dialog_id" = 5b064a2da0eb476abdedeecb;
    limit = 25;
    "sort_desc" = "date_sent";
}
2018-05-29 17:14:02.118973+0530 HelpMeOut[19793:272446] [QBCore]: Response[62]
headers: {
    "Access-Control-Allow-Origin" = "*";
    "Cache-Control" = "no-cache";
    Connection = "keep-alive";
    "Content-Length" = 79;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Tue, 29 May 2018 11:44:02 GMT";
    Duration = "0.305410";
    "QB-Token-ExpirationDate" = "2018-05-29 13:39:35 +0000";
    "QuickBlox-REST-API-Version" = "0.1.1";
    Server = "openresty/1.9.15.1";
    "Set-Cookie" = "_mkra_ctxt=ef530f81163679195d8c83c62b6b6d22--403; path=/; max-age=5; HttpOnly; secure";
    Status = "403 Forbidden";
    "Strict-Transport-Security" = "max-age=31536000";
    "X-Content-Type-Options" = nosniff;
    "X-Frame-Options" = SAMEORIGIN;
    "X-Request-Id" = "3066f892-e783-49f0-9e2e-b757c01794a7";
    "X-Runtime" = "0.025165";
    "X-XSS-Protection" = "1; mode=block";
}
error: Request failed: forbidden (403)
reasons: {
    errors =     (
        "You don't have appropriate permissions to perform this operation"
    );
}

Thanks in advance!

ghost commented 6 years ago

Hi @riteshpatel0,

1). Nothing that could help with your code and logs.

2). Fields Name and Photo - ignored when type=3(PRIVATE)

3). You don't have appropriate permissions to perform this operation- this error means: your user does not contain in the dialog(5b064a2da0eb476abdedeecb) occupants list. (Check this in your admin panel)

4). For example, check our app Q-municate. This functionality works well.

ghost commented 6 years ago

Hi @riteshpatel0, any updates?

RahulTBI commented 5 years ago

Same issue sometime dialog name occur empty

ghost commented 4 years ago

The status of the ticket changed to "Closed" due to inactivity. If the reported issue is still actual for you - please reopen the ticket.