i'm struck with update wallet push notiifcation,i used bellow code,server not connected error.
I missed any credentials.please help to me ,fix this issue.
I registered my passbook and get back pushtoken to server.
this key same as the passbook generate certificate key.
$certifile = 'passbook/certificates/AppleWWDRCA.pem';
$passphrase = 'xxxxxxxx';
$trust ='';
$url = 'ssl://gateway.push.apple.com:2195';
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', $certifile);
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
$fp = stream_socket_client($url, $err, $errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ctx);
if (!$fp)
exit("Failed to connect: $err $errstr" . PHP_EOL);
echo 'Connected to APNS' . PHP_EOL;
$body['aps'] = array(
'alert' => $message,
'sound' => 'default',
'pushToken'=>'xxxxxxxxxxxxxx',
'passTypeId'=>'xxxxxxxxx'
);
$payload = json_encode($body);
$msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;
$result = fwrite($fp, $msg, strlen($msg));
// Close the connection to the server
fclose($fp);
Please help to me.
Connected to server.but i have error in sending push notifictaion.
$body['aps'] = array( );
$msg = chr(0) . pack('n', 32) . pack('H*', $pushToken) . pack('n', strlen($payload)) . $payload;
if (!$result)
echo 'Message not delivered' . PHP_EOL;
else
echo 'Message successfully delivered' . PHP_EOL;
Message not delivered: 10053.
user booking time dynamically pass created and display to device.
if user modify the booking date .I need to update dynamically booking date and time to user pass via pushnotification.
any one please help to me update my passbook.