小编Sal*_*lam的帖子

如何知道所有设备令牌在循环中发送推送通知(APNS)?

我正在尝试使用PHP代码发送给下载我的iPhone应用程序的所有令牌.你能告诉我如何发送到多个设备以及如何进入设备令牌循环吗?

这是我的代码:

<?php

$deviceToken = ''; // HERE I CAN SEND TO ONE DEVICE

// Passphrase for the private key (ck.pem file)
// $pass = '';
// Get the parameters from http get or from command line
$message = $_GET['message'] or $message = $argv[1] or $message = 'MY NOTIFICATION BODY';
$badge = (int)$_GET['badge'] or $badge = (int)$argv[2];
$sound = $_GET['sound'] or $sound = $argv[3];

// Construct the notification payload
$body = array();
$body['aps'] = array('alert' => $message);

if ($badge)
    $body['aps']['badge'] …
Run Code Online (Sandbox Code Playgroud)

php iphone notifications push apple-push-notifications

3
推荐指数
1
解决办法
2万
查看次数