PHP iOS Push notifications arabic multilingual text larger in size

有些话、适合烂在心里 提交于 2019-12-12 02:09:21

问题


I don't really know how to ask these but hopefully i can make myself clear enough for you to understand my questions

Below is the Arabic text which I want to send via Apple iPhone Push Notifications:

يبدا بقرص العقيلي واللقيمات وينتهي مع خالد حرية بالامارات نكهة وبهار مع القصار-٦ مساءا على يشان الليله في انا والعسل مع غاده عبدالرازق تلفزيون الكويت

Can i send this long text?

Because when I prepare a payload, it says 360 bytes of size. While Apple allows only 256 bytes of payload.

What can be done for same?

I'm using this code for same.


回答1:


Doesn't sound like this is something you can work around. Try shortening the notification message and then pointing the user towards your app where you can display a more descriptive message.




回答2:


Got one trick [not sure this is permanent soln though] temporarily: May be handy to other people in future

commented below code of line

//$payload = json_encode($body);

And directly appending JSON format to Payload variable

$payload = '{"aps":{"alert":"'.$message.'","sound":"default","badge":"+1"}}';

Here, $message will be my Arabic string for actula message and it WORKS !!



来源:https://stackoverflow.com/questions/17747510/php-ios-push-notifications-arabic-multilingual-text-larger-in-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!