相关疑难解决方法(0)

Emojis支持Apple推送通知

我正在开发名为"INTERSTIZIO"的iPhone应用程序.在此我实现了用户之间聊天等功能.此用户可以用emojis符号发送文本,位置和文本.如果应用程序在接收端未处于打开模式,则从后端push生成并显示给receiver.I我能够像"UserName:Hello ..."一样显示消息,但我也想在推送消息中显示表情符号,如"UserName:Hay :)"所以任何人都有关于如何使用emojis代码(比如微笑苹果代码是\ u263a)来实现这种类型的推送消息?

我已经按照此链接中给出的解决方案:http://code.iamcal.com/php/emoji/ 但它返回了我在函数中传递的相同代码.它在网页上工作正常,但在推送消息中没有.

在这里,我附上一个推文的屏幕截图,看它如何看待我的结尾.在它中你可以看到我显示了笑脸和灯光符号,但它显示使用HTML支持的代码,如下面的PHP脚本代码:

$lightning = html_entity_decode('',ENT_NOQUOTES,'UTF-8');  
//add this to the 'alert' portion of your APNS payload:  
$message = "You just got the {$lightning}SHOCKER{$lightning}!";
Run Code Online (Sandbox Code Playgroud)

但在我的情况下,我已经从苹果显示内置的表情符号键盘并使用下面的代码我能够获得表情符号代码:

//store code of emojis at backend  
NSData *data = [txtspeech.text dataUsingEncoding:NSNonLossyASCIIStringEncoding];  
NSString *valueUnicode = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

//Display emojis in mobile chat window
NSData *data = [objchat.strchat dataUsingEncoding:NSUTF8StringEncoding];  
NSString *valueEmoj = [[NSString alloc] initWithData:data encoding:NSNonLossyASCIIStringEncoding];  
cell.txtchat.text=valueEmoj;
Run Code Online (Sandbox Code Playgroud)

使用上面的代码,我能够在聊天窗口中存储和显示表情符号,但如果接收者用户已关闭应用程序,那么在推送消息中我无法在推送消息中显示表情符号.

谢谢

在此输入图像描述

php iphone notifications apple-push-notifications ios

8
推荐指数
1
解决办法
8894
查看次数