Note that there are some explanatory texts on larger screens.

plurals
  1. POgetting warning messages while sending push notification to multiple iphone device
    primarykey
    data
    text
    <p>While i am sending push notifications to multiple iphone devices using php webservices i am getting warning messages like :</p> <pre><code>Warning: stream_socket_client() [function.stream-socket-client]: SSL: crypto enabling timeout in /home/sample_app/pushnotification.php on line 66 Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /home/sample_app/pushnotification.php on line 66 Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /home/sample_app/pushnotification.php on line 66 Warning: fclose() expects parameter 1 to be resource, boolean given in /home/sample_app/pushnotification.php on line 79 </code></pre> <p>This is my code :</p> <pre><code>$message='testing'; $q1="select devicetoken from tbl_devicetokens"; $re1 = mysql_query($q1); while($row1=mysql_fetch_row($re1)) { pushMessage($row1[0],$message,'myapp'); } function pushMessage($deviceToken,$message,$app) { echo "Sending iPhone Push Notifications to " . $deviceToken . "&lt;br /&gt;&lt;br /&gt;"; echo "Your Message: " . $message . "&lt;br /&gt;&lt;br /&gt;"; $time = time(); $apnsHost = 'gateway.push.apple.com'; $apnsPort = 2195; $apnsCert = 'apns-myapp.pem'; $streamContext = stream_context_create(); stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert); $apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext); if($apns) { $payload = array(); $payload['aps'] = array('alert' =&gt; $message, 'badge' =&gt; 0, 'sound' =&gt; 'default'); $payload = json_encode($payload); $apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $deviceToken)) . chr(0) . chr(strlen($payload)) . $payload; fwrite($apns, $apnsMessage); } else { echo "Connection Failed - iPhone Push Notifications Server"; echo $errorString."&lt;br /&gt;"; echo $error."&lt;br /&gt;"; } //socket_close($apns); fclose($apns); } </code></pre> <p>So, can any one tell me how to solve this problem</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload