Comments (6)
It looks like the issue is using utf8 encoding on the payload doesn't handle the extended unicode characters (or doesn't play well with APNS). Changing the encoding to usc2 fixes the issue, but I'm not sure if it breaks anything else at this point. Will let you know.
from node-apn.
Oh that's absolutely the case, I'm pretty sure that emoji falls under UTF-16. Let me know how the encoding change goes, I'll investigate unicode support in javascript/node and see what I can find out.
Unicode is crazy.
from node-apn.
The change is very simple and shouldn't break anything since UCS2 is the predecessor to UTF-16. The disadvantage is it halves the number of characters you can fit in the 256 byte payload. So, probably makes sense to give people the option. The change is in sendNotification:
var messageLength = Buffer.byteLength(message, encodingMethod);
...
pos += data.write(message, pos, encodingMethod);
where encodingMethod is 'ucs2' or 'utf8' - default is utf8 for these functions.
from node-apn.
I will add an option for this and update the readme soon. I think I will add this on a per message basis, I am going to refrain from making it a global setting because of the detrimental nature of halving the message length. Thanks for figuring this out.
from node-apn.
Could you please share java code for sending Advance Emoji or images?
from node-apn.
This library is for JavaScript, not Java. Please checkout https://github.com/notnoop/java-apns for a Java version.
―A
On 15 Jun 2015, at 15:19, pashtika [email protected] wrote:
Could you please share java code for sending Advance Emoji or images?
―
Reply to this email directly or view it on GitHub.
from node-apn.
Related Issues (20)
- 1
- Error: Socket unusable after connection. Hint: You may be using a certificate for the wrong environment HOT 1
- Deploying to Flywheel workflow failing saying inputs not valid
- ERR_CRYPTO_OPERATION_FAILED HOT 3
- High Vulnerability on node-forge-0.7.6.tgz (Vulnerable Library)
- iOS Push Notification Error: {reason: 'TopicDisallowed'} HOT 3
- How to send Communication Notifications? HOT 5
- Critical security vuln: jsonwebtoken HOT 2
- Live Activity Support
- How to use P12 files to send pushes HOT 8
- Send Push Notification To Apple Watch
- apn write failed: GOAWAY: PROTOCOL_ERROR Stream 5 does not exist HOT 1
- The future of `node-apn`
- Show In Foreground?
- Dynamically or using RESTful API to add device
- What is the right way to send a silent push notification(content-available = 1) in 2024?
- Port from http to fetch
- Is there a way to retrieve the `aps-unique-id` return header value?
- Is this package abandoned?
- is it possible to send push to multiple devices with multiple payloads using node-apn without looping?
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 node-apn.