Commit 9c61fd05 by 冷斌

fix bug

parent 1e9abf31
......@@ -773,13 +773,15 @@ class Model_Live extends PhalApi_Model_NotORM {
require_once dirname(dirname(__DIR__)).'/public/JPush/autoload.php';
$client = new \JPush\Client($app_key, $master_secret,null);
$title = '中奖全房间通知';
try{
$stauts = $client->push()
->setPlatform('all')
->message($title, [
'title' => $title,
'extras' => $data,
])
$results = array_chunk($pushids, 999);
foreach ($results as $result) {
try{
$client->push()
->setPlatform('all')
->message($title, [
'title' => $title,
'extras' => $data,
])
// ->setNotificationAlert($title)
// ->iosNotification($title, array(
// 'sound' => 'sound.caf',
......@@ -797,17 +799,19 @@ class Model_Live extends PhalApi_Model_NotORM {
// ),
// ))
->addRegistrationId($pushids)
->options(array(
'sendno' => 100,
'time_to_live' => 0,
'apns_production' => $apns_production,
))
->send();
}catch (\Exception $exception) {
var_dump($exception->getMessage());
die;
->addRegistrationId($result)
->options(array(
'sendno' => 100,
'time_to_live' => 0,
'apns_production' => $apns_production,
))
->send();
}catch (\Exception $exception) {
}
}
}
/* 赠送礼物 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment