Answer the question
In order to leave comments, you need to log in
Sending long Cyrillic push notifications on iPhone?
Faced such a problem when implementing push notifications.
It's no secret that the payload when sending a push notification cannot exceed 256 bytes (the total weight of the JSON that is sent to the apple server)
The problem is that when we json_encode a string containing Cyrillic, we get something like
{
"aps":
{
"alert":"\u0412 \u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0431\u0443\u0440\u0433\u0435 \u043e\u0442\u043a\u0440\u044b\u043b\u0441\u044f \u0444\u0440\u0430\u043d\u0448...",
"sound":"default"
},
"message-type":"new-news"
}
Answer the question
In order to leave comments, you need to log in
As far as I know, in JSON you can write directly in Cyrillic in UTF8. In this case, you will only need 2 bytes per character.
At least JS and PHP handle such JSON very well. I assume there will be an iPhone too.
After all, you can pass the key for the localizable string and separately the arguments for it - this does not help to save money?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question