zoukankan      html  css  js  c++  java
  • Emojis support in Apple push notification

    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 : http://code.iamcal.com/php/emoji/ 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

  • 相关阅读:
    【09-04】java内部类学习笔记
    【09-03】java泛型学习笔记
    【08-23】redis学习笔记
    【06-23】js动画学习笔记01
    【11-23】mysql学习笔记02
    【06-18】CentOS使用笔记
    thinkphp+datatables+ajax 大量数据服务器端查询
    python遗传算法实现数据拟合
    简单的新闻客户端APP开发(DCloud+thinkphp+scrapy)
    python游戏编程——跟13岁儿童学编程
  • 原文地址:https://www.cnblogs.com/ihojin/p/emoji-in-ios.html
Copyright © 2011-2022 走看看