While I am sending the emoji to server "\ud83d\ude0e" (emoji unicode) in the given format, the server could not understand the code and while sending push notification from server to device, the notification is not coming.
I have used :
NSData *data = [self.activeTextField.text dataUsingEncoding:NSNonLossyASCIIStringEncoding];
NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
to encode the message(emoji) while sending and used:
NSData *data = [strReceivedMsg dataUsingEncoding:NSUTF8StringEncoding];
NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSNonLossyASCIIStringEncoding];
while receiving the messages.
Please suggest how to resolve this issue
Thanks
NSString *string = @"This is \u00B7";
Instead of \u00B7 add your unicode value. Its working solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With