PHP Apple iPhone Push notifications Arabic longer text large in size -


i sending english texts iphone push notifications upto 140 characters long, whenever try same in arabic language doesn't allow more longer 35-40 chars only.

now, when check size, using strlen() function , utf8_encode shows me of size 190 bytes , total payload limit allowed iphone 256 bytes only.

below arabic text want send:

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

it little longer, there solution using can send apple iphone push notifications?

do needs change/encode special characters except json format, allows apple read , allow me sending.

please me achieve same.

thanks in advance.

my code push notifications, this:

$devicetoken = '**********************';   $payload['aps'] = array('alert' => 'my arabic text', 'badge' => 1, 'sound' => 'default');   $payload = json_encode($payload);  $passphrase = '***';  $apnshost = 'gateway.sandbox.push.apple.com'; $apnsport = 2195; $apnscert = 'ck.pem';  $streamcontext = stream_context_create(); stream_context_set_option($streamcontext, 'ssl', 'local_cert', $apnscert);  stream_context_set_option($streamcontext, 'ssl', 'passphrase',$passphrase );  $apns = stream_socket_client('ssl://' . $apnshost . ':' . $apnsport, $error, $errorstring, 2, stream_client_connect, $streamcontext);  $apnsmessage = chr(0) . pack("n",32) . pack('h*', str_replace(' ', '', $devicetoken)) . pack("n",strlen($payload)) . $payload;  $result=fwrite($apns, $apnsmessage);  fclose($apns); 


Comments