调试极光推送
This commit is contained in:
parent
a54e837d74
commit
315c87c754
@ -18,9 +18,10 @@ class JgPush
|
|||||||
{
|
{
|
||||||
$this->client = new Client('b5f679f4357018605ea6fd2e', 'c4fb573758f8d7058d697c54');
|
$this->client = new Client('b5f679f4357018605ea6fd2e', 'c4fb573758f8d7058d697c54');
|
||||||
$this->push = $this->client->push();
|
$this->push = $this->client->push();
|
||||||
|
$this->setPlatform();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init($type, $data)
|
public function send($type, $data)
|
||||||
{
|
{
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'ADMIN_PAY_SUCCESS_CODE':
|
case 'ADMIN_PAY_SUCCESS_CODE':
|
||||||
@ -36,6 +37,7 @@ class JgPush
|
|||||||
$this->addRegistrationId($jgRegisterId);
|
$this->addRegistrationId($jgRegisterId);
|
||||||
$this->androidNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]);
|
$this->androidNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]);
|
||||||
$this->iosNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]);
|
$this->iosNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]);
|
||||||
|
$this->push->send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -49,14 +51,13 @@ class JgPush
|
|||||||
$this->addRegistrationId($jgRegisterId);
|
$this->addRegistrationId($jgRegisterId);
|
||||||
$this->androidNotification('您的订单已发货,请注意查看。', ['extras' => ['route' => $route]]);
|
$this->androidNotification('您的订单已发货,请注意查看。', ['extras' => ['route' => $route]]);
|
||||||
$this->iosNotification('您的订单已发货,请注意查看。', ['extras' => ['route' => $route]]);
|
$this->iosNotification('您的订单已发货,请注意查看。', ['extras' => ['route' => $route]]);
|
||||||
|
$this->push->send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->setPlatform();
|
|
||||||
return $this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,10 +30,10 @@ class SendSmsJob implements JobInterface
|
|||||||
$status = app()->make(SystemNoticeConfigRepository::class)->getNoticeStatusByConstKey($data['tempId']);
|
$status = app()->make(SystemNoticeConfigRepository::class)->getNoticeStatusByConstKey($data['tempId']);
|
||||||
if ($status['notice_app'] == 1) {
|
if ($status['notice_app'] == 1) {
|
||||||
try {
|
try {
|
||||||
/** @var JgPush $push */
|
/** @var JgPush $client */
|
||||||
$push = app()->make(JgPush::class);
|
$client = app()->make(JgPush::class);
|
||||||
Log::info('app推送发送数据:' . var_export($data, 1));
|
Log::info('app推送发送数据:' . var_export($data, 1));
|
||||||
$push->init($data['tempId'], $data)->push->send();
|
$client->send($data['tempId'], $data);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::info('app推送消息发送失败' . var_export($data, 1) . $e->getMessage());
|
Log::info('app推送消息发送失败' . var_export($data, 1) . $e->getMessage());
|
||||||
DingTalk::exception($e, 'app推送消息发送失败' . var_export($data, 1));
|
DingTalk::exception($e, 'app推送消息发送失败' . var_export($data, 1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user