博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Emojis support in Apple push notification
阅读量:6199 次
发布时间:2019-06-21

本文共 1877 字,大约阅读时间需要 6 分钟。

I am working on iPhone app named "INTERSTIZIO".In this I have implemented functionality like chat between users.In this user can send text,location and text with emojis symbol.If the app is not in open mode at receiver end then from backend push is generated and display to receiver.I am able to display message in push like "UserName : Hello..." but I also want to display emojis symbol, like "UserName : Hay :)" in push message so anyone have idea regarding how I can achieve this type of push message using emojis code(like for smile apple code is \u263a) of apple?

I have followed the solution given in this link :  But it returns the same code that I have passed in function.Its working fine on web pages but not in push message.

Here I am attaching one screen shot of the push how it looks at my end.In it you can see that I have displayed smiley and lighting symbol but its displayed using HTML supported code like below code of PHP script:

$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}!";

But in my case I have displayed inbuilt emojis keyboard from apple and using below code I am able to get emojis code :

//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;

Using above code I am able to store and display emojis in chat window but if receiver user have closed app then in push message I am not able to display emojis symbol in push message.

Thanks

enter image description here

转载地址:http://dwtca.baihongyu.com/

你可能感兴趣的文章
PHP小练习题
查看>>
cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,
查看>>
记录日志
查看>>
这两天用到的Jmeter录制
查看>>
无法在“EntityFramework”已存在的情况下创建影像复制该文件的解决方案
查看>>
阿里云系列——5.网站云解析快速配置(简单+免费+详细+最新)
查看>>
asp.net html标签过滤
查看>>
sql连接查询
查看>>
css3 text-shadow
查看>>
BZOJ4446:[SCOI2015]小凸玩密室(树形DP)
查看>>
[转]Windows 语音编程初步
查看>>
微信开发_网页授权获取用户的基本信息
查看>>
chmod的运用方式
查看>>
一句话设置UITextField、UITextview的字数限制和placeholder
查看>>
PHP反射机制实现自动依赖注入
查看>>
curl 错误总结
查看>>
vue-cli3 创建项目报”asyncWrite is not a function“错误的解决方法
查看>>
启动页
查看>>
[开源]KJFramework.Message 高性能二进制消息框架 - 多元素数组的高性能优化
查看>>
自用获取数据函数封装
查看>>