Commit 9c61fd05 by 冷斌

fix bug

parent 1e9abf31
...@@ -773,13 +773,15 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -773,13 +773,15 @@ class Model_Live extends PhalApi_Model_NotORM {
require_once dirname(dirname(__DIR__)).'/public/JPush/autoload.php'; require_once dirname(dirname(__DIR__)).'/public/JPush/autoload.php';
$client = new \JPush\Client($app_key, $master_secret,null); $client = new \JPush\Client($app_key, $master_secret,null);
$title = '中奖全房间通知'; $title = '中奖全房间通知';
try{ $results = array_chunk($pushids, 999);
$stauts = $client->push() foreach ($results as $result) {
->setPlatform('all') try{
->message($title, [ $client->push()
'title' => $title, ->setPlatform('all')
'extras' => $data, ->message($title, [
]) 'title' => $title,
'extras' => $data,
])
// ->setNotificationAlert($title) // ->setNotificationAlert($title)
// ->iosNotification($title, array( // ->iosNotification($title, array(
// 'sound' => 'sound.caf', // 'sound' => 'sound.caf',
...@@ -797,17 +799,19 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -797,17 +799,19 @@ class Model_Live extends PhalApi_Model_NotORM {
// ), // ),
// )) // ))
->addRegistrationId($pushids) ->addRegistrationId($result)
->options(array( ->options(array(
'sendno' => 100, 'sendno' => 100,
'time_to_live' => 0, 'time_to_live' => 0,
'apns_production' => $apns_production, 'apns_production' => $apns_production,
)) ))
->send(); ->send();
}catch (\Exception $exception) { }catch (\Exception $exception) {
var_dump($exception->getMessage()); }
die;
} }
} }
/* 赠送礼物 */ /* 赠送礼物 */
......
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