paddy
paddy

Reputation: 47

Does APNS understand UTF-8 encoded payload

I am using Apns-Node.js for sending push notifications to my iOS device and GCM-Node.js for my Android device.

Currently I have a payload sent to APNS which contains special characters like "ü" in the payload. This gets displayed in the same format and doesn't get truncated or modified by APNS for any reason.

But my Android app has this issue where GCM truncates the special character in the payload unless it is encoded using URL encoding.

 "türken" -> gets truncated to "trken" unless it is encoded like "t%C3%BCrken" in GCM only

In an effort to keep both platforms uniform, can I send the encrypted payload to APNS as well? And if I do so, will APNS understand the UTF-8 format and send the payload with special character to the device? My expectation is that APNS should understand the encoded format "t%C3%BCrken" and send "türken" to the device. Will this work?

Upvotes: 0

Views: 909

Answers (1)

allenh
allenh

Reputation: 6622

Based on your explanation, APNS properly supports UTF-8. This means it will deliver the payload as is.

This means if you send "t%C3%BCrken", then the client will receive "t%C3%BCrken", but your iOS client applications can easily remove the percent encoding by using removingPercentEncoding.

Upvotes: 1

Related Questions