phpunicodeapple-push-notificationsapns-php

APNs unicode message from russian language


I have a problem with the Cyrillic alphabet in the message, the server is written in php, the output is the following string of 285 characters.

string(285) "{"aps":{"alert":"\u041f\u0440\u043e \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 Redis \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u0430\u044f","badge":0,"sound":"default","id":"100","category":"nat"}}"

When I write it on the English I get a string 180 characters. Because this message is not sent to the server Apple, since the size of the format. I do not know where the correct message.


Solution

  • i found solution json_encode($payload, JSON_UNESCAPED_UNICODE);