无法接收推送通知iOS

时间:2014-11-04 03:27:37

标签: php ios apple-push-notifications

我有3个令牌:Token1,Token2,Token3 Token1推送通知确定

令牌2推送通知不行

令牌3推送通知确定

Token3是我的设备

如果我推送到Token1,Token3 =>好。我收到了消息。

如果我推送到Token2,Toten3 => NG。我无法收到消息。

我使用PHP推送通知:

if (!$fp)
    exit("Failed to connect: $err $errstr" . PHP_EOL);

// Create the payload body
$body['aps'] = array(
    'alert' => $message,
    'sound' => 'default'
);

// Encode the payload as JSON
$payload = json_encode($body);

foreach ($token_devices as $token_device) {
    // Build the binary notification
    $msg = chr(0) . pack('n', 32) . pack('H*', $token_device->token) . pack('n', strlen($payload)) . $payload;

    // Send it to the server
    $result = fwrite($fp, $msg, strlen($msg));
}

fclose($fp);

现在我需要推送到Token2,Token3 =>我的设备是Token3可以接收消息。 请帮忙!!!!

0 个答案:

没有答案
相关问题