iOS Mass Push notification using PHP
- Status: Closed
- Prize: $15
- Entries Received: 1
- Winner: vaishali1191
Contest Brief
We have a php code to send a message to ios Push Registration devices and push notification is working fine if it is sent one by one using this code
$deviceToken = "Actual Device Token";
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
// Open a connection to the APNS server
//$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $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' => array(
'title' => $ntitle,
'body' => $msg,
),
'url' => $nurl,
'sound' => 'default'
);
We need a code to send it in batches to 1000 like android allows.
Secondly we want to know which device tokens failed.
Recommended Skills
Employer Feedback
“very nice work”
safelistad, India.
Public Clarification Board
How to get started with contests
-
Post Your Contest Quick and easy
-
Get Tons of Entries From around the world
-
Award the best entry Download the files - Easy!