ios - Emoji Coming from server is not getting fetched -
in app using webservice it's response contains emoji. response get's break , got nothing in response. can 1 help! code:=
if ([[appdelegate instance] checkinternetconnection]) { nsmutabledictionary *dictparam = [nsmutabledictionary dictionary]; [dictparam setvalue:_str_eventid forkey:@"event_id"]; [dictparam setvalue:[self.dict_logindata valueforkey:@"id"] forkey:@"uid"]; nserror *error; nsdata *jsondata = [nsjsonserialization datawithjsonobject:dictparam options:nsjsonwritingprettyprinted // pass 0 if don't care readability of generated string error:&error]; nsstring *jsonstring = [[nsstring alloc] initwithdata:jsondata encoding:nsutf8stringencoding]; nslog(@"json string %@",jsonstring); if (jsondata) { [[appdelegate instance] showloadinghud:loading]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:[nsurl urlwithstring:api_barflyerdetail]cachepolicy:nsurlrequestreloadignoringcachedata timeoutinterval:60.0]; [request sethttpmethod:@"post"]; [request sethttpbody:jsondata]; [request setvalue:app_token forhttpheaderfield:@"token"]; afhttprequestoperation *op = [[afhttprequestoperation alloc] initwithrequest:request]; op.responseserializer = [afjsonresponseserializer serializer]; op.responseserializer.acceptablecontenttypes = [nsset setwithobjects:@"text/plain",@"text/html",@"application/json", nil]; [op setcompletionblockwithsuccess:^(afhttprequestoperation *operation, id responseobject) { [[appdelegate instance] hideloadinghud]; if ([[responseobject valueforkey:@"success"] integervalue]==1) { arrflyerdetails = [responseobject valueforkey:@"data"]; } else { // [uialertview infoalertwithmessage:[responseobject valueforkey:@"message"] andtitle:app_name]; } }
when try convert emoji string in nsdata return nil.so save emoji in utf8 string on server.now can decode string , emoji.
Comments
Post a Comment