My last app get a lot of user (> 200 000), i have set my own push solution.
Nevertheless i'm facing new problems and when i want to push all my user the same time.
After opened a ssl connexion i make a loop with all token and using if the token is valid (isDigit and length > 64 ) but what i have understood is that one of the token is no more valid regarding my apns .pem apns will stop the loop. I know i need to call the feedback service to get my invalid token but i push my user for the first the apns will stop my loop and i can't get any feedback service !
I have set a simple php script to get feedback :
<?php
$stream_context = stream_context_create();
stream_context_set_option($stream_context, 'ssl', 'local_cert', 'myApns.pem');
$apns = stream_socket_client('ssl://feedback.push.apple.com:2196',
$errcode, $errstr, 60, STREAM_CLIENT_CONNECT, $stream_context);
if(!$apns) {
echo "ERROR $errcode: $errstr\n";
return;
}
$feedback_tokens = array();
//and read the data on the connection:
while(!feof($apns)) {
$data = fread($apns, 38);
if(strlen($data)) {
$feedback_tokens[] = unpack("N1timestamp/n1length/H*devtoken", $data);
}
}
fclose($apns);
print_r($feedback_tokens);
echo("done");
?>
But it always print me a null array (Array()). Is there any solution in php so i send my token to the apns which verify the token is valid or not?