Search code examples
iosapple-push-notificationsapns-php

Apple Push Notification Hebrew


I am using Apns-PHP for sending push notification to IOS devices, below is the link of open source code which I have applied.

http://code.google.com/p/apns-php

It is working fine for English text messages however, for Hebrew text message sometimes its send null as text message. To overcome with it, I have applied solution suggested by the following link.

https://stackoverflow.com/a/10936493/1928421

As per the above link I have replaced my payload function with the given method, now I some text message is coming in push message but it seems like they are formatted with UTF8.

Here is the actual Hebrew text that I am passing to Apns.

"האילנית לזון זקוק לעזרה כדי לקחת מ גבעה ל ת"

And this the dictionary which is getting created by the script.

[aps] => Array (
  [alert] => Array (
    [body] => "\u05d4\u05d0\u05d9\u05dc\u05e0\u05d9\u05ea \u05dc\u05d6\u05d5\u05df \u05d6\u05e7\u05d5\u05e7 \u05dc\u05e2\u05d6\u05e8\u05d4 \u05db\u05d3\u05d9 " 
  ) 
  [badge] => 3
)

on device hand for the alert key I am receiving following text only.

"\u05d4\u05d0\u05d9\u05dc\u05e0\u05d9\u05ea \u05dc\u05d6\u05d5\u05df \u05d6\u05e7\u05d5\u05e7 \u05dc\u05e2\u05d6\u05e8\u05d4 \u05db\u05d3\u05d9 "

Any comment or suggestion is highly appreciated.


Solution

  • I have just downloaded the latest code from ** https://github.com/duccio/ApnsPHP/ ** and its works absolutely fine