修复极光推送消息发送失败
This commit is contained in:
parent
c32ced1c0e
commit
33f6df8d03
@ -27,6 +27,7 @@
|
||||
}
|
||||
|
||||
public function sendMsg($register_id,$message,$route = '',$type = 1){
|
||||
$res = true;
|
||||
try {
|
||||
$this->client = new Client($this->iosKey, $this->iosSecret);
|
||||
$this->push = $this->client->push();
|
||||
@ -35,10 +36,9 @@
|
||||
$this->push->iosNotification($message, ['extras' => ['route' => $route, 'type' => $type]]);
|
||||
$this->push->send();
|
||||
unset($this->client, $this->push);
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
return $e->getMessage();
|
||||
$res = false;
|
||||
}
|
||||
try {
|
||||
$this->client = new Client($this->azKey, $this->azSecret);
|
||||
@ -48,11 +48,11 @@
|
||||
$this->push->androidNotification($message, ['extras' => ['route' => $route, 'type' => $type]]);
|
||||
$this->push->send();
|
||||
unset($this->client, $this->push);
|
||||
return true;
|
||||
$res = true;
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
return $e->getMessage();
|
||||
|
||||
$res = false;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user