Comments (4)
Take a look at issue #7 - APNS does some weird handling for escaping Unicode, so you'll probably need to manually find the surrogate pair and then double encode your emoji. e.g.
$message = "\\uD83D\\uDCC5" . "This is an emoji";
Let me know if that works for you and i'll update the README
from php-emoji.
The suggested solution did not work. Instead of emoji, I am now getting a \?
in the notification. Here's what I get now in push notification...
?This is an emoji.
Here is a gist of the code I used.
from php-emoji.
It seems like Apns-PHP is just broken. Find this line in ApnsPHP/Message.php
:
if (!defined('JSON_UNESCAPED_UNICODE') && function_exists('mb_convert_encoding')) {
It should be around line 376. Add && 0
into the conditional, to stop it from ever firing. It should then work. My test code is here: https://gist.github.com/iamcal/6169622
from php-emoji.
@iamcal - Thank you very much for your prompt support. The solution you suggested worked out well.
Just for information, the code in APNS-PHP that will not be fired is the one related to truncating a payload if it exceeds the limit of permissible push notification size (256 bytes).
I had some payloads exceeding the limit, so I decided to truncate them before sending the push notification, instead of making APNS-PHP handle the truncating.
from php-emoji.
Related Issues (20)
- No background-position for emoji1f320 (U+1F320, shooting star) HOT 1
- Composer support HOT 13
- generate a map with the latest emoji available HOT 9
- Not working. HOT 2
- Error Cannot redeclare emoji_docomo_to_unified()
- Problem to send Camera Emoji in Push Notification
- Retina support HOT 2
- Many emojis aren't supported on emoji_unified_to_html HOT 1
- Emoji picture is too large. HOT 1
- emoji1f610 wrong positioned HOT 2
- emoji_name_to_unified
- NN
- Adding extra emojis! HOT 10
- update composer version HOT 2
- Emoji picker corresponding with this library?
- Some emoticons leave residual data in the string after conversion HOT 4
- False positives for emoji_contains_emoji HOT 1
- Some Emoji Still Not Supported
- Problem to send emoji to Push Notification HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-emoji.