Skip to content

Commit

Permalink
ios push
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwu123 committed Aug 17, 2019
1 parent 29836e5 commit 2dc7922
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions src/Push/CommonMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ class CommonMessage

private $alias_type = '';

private $iosBadge = '';

/**
* @return string
*/
public function getIosBadge()
{
return $this->iosBadge;
}

/**
* @param string $iosBadge
* @return $this
*/
public function setIosBadge($iosBadge)
{
$this->iosBadge = $iosBadge;
return $this;
}

/**
* 定制的
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Request/SendRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ public function iosSend($sign, CommonMessage $commonMessage)
$payload = IosPayload::make()
->setContentAvailable(true)
->setAlert($commonMessage->getTitle(), $commonMessage->getDesc(), $commonMessage->getTicker())
->setOtherParams($commonMessage->getOtherParams())
->setBadge('+1');
->setOtherParams($commonMessage->getOtherParams());
if ($commonMessage->getIosBadge()) {
$payload->setBadge($commonMessage->getIosBadge());
}
$policy = Policy::make()->setOutBizNo($sign);
return $this->send($message, $payload, $policy);
}
Expand Down

0 comments on commit 2dc7922

Please sign in to comment.