Awesome q2a theme

Sending Cyrillic long push notifications on your iPhone?

0 like 0 dislike
30 views
Faced with this problem when implementing push notifications.


It is no secret that the payload, when sending a push notification can not exceed 256 bytes (the total weight of the JSON that is sent to the apple server)


The problem is that when we do json_encode a string containing the Cyrillic alphabet, the output 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" }



That is, each character of the Cyrillic alphabet is encoded in 6 bytes, which significantly reduces the volume of the payload of a PUSH message. How you bypass this restriction?
by | 30 views

2 Answers

0 like 0 dislike
As far as I know JSON, you can write directly in Cyrillic in UTF8. In this case, you have the character to go just 2байта.
At least JS and PHP this JSON perfectly hawala. I assume that the iPhone will also be.
by
0 like 0 dislike
Because you can transfer the key for the localizable string and separate arguments for it — it does not help to save?
by

Related questions

0 like 0 dislike
4 answers
0 like 0 dislike
3 answers
asked Mar 21, 2019 by ilukyanov
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
7 answers
110,608 questions
257,187 answers
0 comments
40,796 users