iphone - How to send Push Notification to multiple devices? -


this first time using push notification in app.i have gone through sample applications along books , got how send push notification single device.but not getting changes should in program send push notification multiple devices.i using 'pushmebaby' application server side coding. please,help me out. in advance.

try example code , modify environment.

    $apnshost = '<apns host>';     $apnsport = <port num>;     $apnscert = '<cert>';      $streamcontext = stream_context_create();     stream_context_set_option($streamcontext, 'ssl', 'local_cert', $apnscert);      $apns = stream_socket_client('ssl://' . $apnshost . ':' . $apnsport, $error, $errorstring, 60, stream_client_connect, $streamcontext);      $payload['aps'] = array('alert' => 'some notification', 'badge' => 0, 'sound' => 'none');     $payload = json_encode($payload);  // note: $device_tokens_array has list of 5 devices' tokens      for($i=0; $i<5; $i++)     {             $apnsmessage = chr(0) . chr(0) . chr(32) . pack('h*', str_replace(' ', '', $device_tokens_array[i])) . chr(0) . chr(strlen($payload)) . $payload;              fwrite($apns, $apnsmessage);     }?> 

this article helps verifying drop connection , connection status: apple push notification: sending high volumes of messages

other reference links:

how can send push notification multiple devices in 1 go in iphone? , how handle multiple devices when using push notification?


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -