Quantcast
Channel: PHP Push notification service, feedback is empty,how can i to do - Stack Overflow
Viewing all articles
Browse latest Browse all 2

PHP Push notification service, feedback is empty,how can i to do

$
0
0

The push works just fine, the problem is that the feedback is empty. I need to delete the tokens that have expired or have an invalid status.This is what I write test code,this a problem?]

$ctx = stream_context_create(); 
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem'); 
$fp = stream_socket_client('ssl://feedback.sandbox.push.apple.com:2196', $error, $errorString, 60, STREAM_CLIENT_CONNECT, $ctx); 
if (!$fp) { 
  return; 
} 
while ($devcon = fread($fp,38)) { 
  $arr = unpack("H*", $devcon); 
  $rawhex = trim(implode("", $arr)); 
  $feedbackTime = hexdec(substr($rawhex, 0, 8)); 
  $feedbackDate = date('Y-m-d H:i', $feedbackTime); 
  $feedbackLen = hexdec(substr($rawhex, 8, 4)); 
  $feedbackDeviceToken = substr($rawhex, 12, 64); 
} 
fclose($fp);

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images