QuickBlox / quickblox-ios-sdk

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

Causing serious issue while entering the emojis and special characters like ',&"". are displaying with text in the last message. #459

Closed ajay2c9 closed 8 years ago

ajay2c9 commented 8 years ago

Help avoid duplicate issue reports, check existing issues

Environment details iOS version, Quickblox iOS SDK version, QuickbloxWebRTC SDK version (optional) iOS Version > 8.4 Quickblox iOS SDK version 2.7.2 QMServices version 0.4

Did this work before? NO

Expected behavior I am getting text while entering the emojis and special characters. These are the images of dialogs how it displaying and dialog data. and how to display.

1.Text is displaying like this. screen shot 2016-05-18 at 6 00 41 pm

Dialog data:

{ "_id" = 5735a5a8a28f9a7a470000a0; "created_at" = "2016-05-13T10:00:08Z"; "last_message" = ""I'm so tired but can't be friends again in my head"."; "last_message_date_sent" = 1463574401; "last_message_user_id" = 12477967; name = "LACK,SANDRA"; "occupants_ids" = ( 12477923, 12477967 ); photo = ""; type = 2; "unread_messages_count" = 0; "updated_at" = "2016-05-18T12:26:41Z"; "user_id" = 12477967; "xmpp_room_jid" = "36508_5735a5a8a28f9a7a470000a0@muc.chat.quickblox.com"; },

The Text i entered is : screen shot 2016-05-18 at 6 03 56 pm

2.Emojis are displaying with text like this:

screen shot 2016-05-18 at 6 00 54 pm

DialogData : { "_id" = 573b1eb1a28f9a8a43000056; "created_at" = "2016-05-17T13:37:53Z"; "last_message" = "\Ud83d\Ude2a\Ud83d\Ude43\Ud83d\Ude27\Ud83e\Udd15\Ud83d\Ude2a\Ud83d\Ude31\Ud83e\Udd15\Ud83d\Ude27\Ud83d\Ude43\Ud83d\Ude27\Ud83d\Ude2a\Ud83d\Ude0e\Ud83d\Ude41\Ud83d\Ude12\Ud83d\Ude1f\Ud83d\Ude1f\Ud83d\Udc69‍\Ud83d\Udc69‍\Ud83d\Udc67‍\Ud83d\Udc66\Ud83d\Udc69‍\Ud83d\Udc69‍\Ud83d\Udc67‍\Ud83d\Udc66\Ud83d\Udc6a\Ud83d\Udc69‍\Ud83d\Udc69‍\Ud83d\Udc67‍\Ud83d\Udc66\Ud83d\Udc68‍\Ud83d\Udc69‍\Ud83d\Udc67\Ud83d\Udc69‍\Ud83d\Udc69‍\Ud83d\Udc67‍\Ud83d\Udc66\Ud83d\Udc69‍\Ud83d\Udc69‍\Ud83d\Udc67‍\Ud83d\Udc66\Ud83d\Udc69‍\Ud83d\Udc69‍\Ud83d\Udc67\Ud83d\Udc68‍\Ud83d\Udc68‍\Ud83d\Udc66‍\Ud83d\Udc66"; "last_message_date_sent" = 1463496222; "last_message_user_id" = 12477923; name = "LACK,HENRY,LOOSE,SANDRA"; "occupants_ids" = ( 12477967, 12477970, 12369036, 12477923 ); photo = ""; type = 2; "unread_messages_count" = 0; "updated_at" = "2016-05-17T14:43:42Z"; "user_id" = 12477967; "xmpp_room_jid" = "36508_573b1eb1a28f9a8a43000056@muc.chat.quickblox.com"; },

The Text i received is :

screen shot 2016-05-18 at 6 13 58 pm

This response header log:

[QBCore] Request headers: { "Content-Type" = "application/json"; "QB-OS" = "iOS 9.3"; "QB-SDK" = "iOS 2.7"; "QB-Token" = 0a23e6cb1da11e6ba5c234fac57124f0fd16611c; "QuickBlox-REST-API-Version" = "0.1.1"; }

[QBCore] Response headers: { "Access-Control-Allow-Origin" = "*"; "Cache-Control" = "max-age=0, private, must-revalidate"; Connection = "keep-alive"; "Content-Length" = 2041; "Content-Type" = "application/json; charset=utf-8"; Date = "Wed, 18 May 2016 12:27:24 GMT"; Etag = "\"60250a1b60483f384b643feb71ad9d3f\""; "QB-Token-ExpirationDate" = "2016-05-18 14:27:13 UTC"; "QuickBlox-REST-API-Version" = "0.1.1"; Server = "nginx/1.8.1"; Status = "304 Not Modified"; "Strict-Transport-Security" = "max-age=15768000;"; "X-Rack-Cache" = miss; "X-Request-Id" = bd31acb1d5fd8421d6db545724543d46; "X-Runtime" = "0.018192"; "X-UA-Compatible" = "IE=Edge,chrome=1"; }

I am facing this issue in this manner : I enter the text or emojis and check in the dialogs page the emojis those are looking fine without any issue. when I logout and login with same user i am facing the issue. For displaying the last message i am using the attribute string and code is like this:

NSMutableAttributedString*attributedString = [[NSMutableAttributedString alloc] initWithString:[chatDialog.lastMessageText uppercaseString]];

                NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
                [paragraphStyle setLineSpacing:3];
                paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
                [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [str length])];
                cell.redmessageLabel.attributedText =attributedString;

Give suggestions to solve this issue

Thank you

ghost commented 8 years ago

Hi @ajay2c9 , Closed as duplicated #378

ajay2c9 commented 8 years ago

is there any update on this issue?