Skip to content

Commit 64e0c93

Browse files
committed
Merge branch 'release/1.0.2'
2 parents e6558e0 + aae6e40 commit 64e0c93

File tree

7 files changed

+29
-10
lines changed

7 files changed

+29
-10
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Release Notes
22

3-
## [Unreleased](https://github.com/sunaoka/push-notifications-php/compare/1.0.1...develop)
3+
## [Unreleased](https://github.com/sunaoka/push-notifications-php/compare/1.0.2...develop)
4+
5+
## [v1.0.2 (2021-10-13)](https://github.com/sunaoka/push-notifications-php/compare/1.0.1...1.0.2)
6+
7+
### Added
8+
9+
- Added DriverOption::httpOptions (Guzzle Request Options)
10+
11+
### Fixed
12+
13+
- Fixed a bug that APNs by using token failed
414

515
## [v1.0.1 (2021-10-13)](https://github.com/sunaoka/push-notifications-php/compare/1.0.0...1.0.1)
616

src/Drivers/APNs/Certificate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ public function __construct($options)
5353
*/
5454
public function send()
5555
{
56-
$this->httpClient = $this->getHttpClient([
56+
$this->httpClient = $this->getHttpClient(array_merge($this->options->httpOptions, [
5757
'version' => 2.0,
5858
'cert' => [
5959
$this->options->certificate,
6060
$this->options->password,
6161
],
62-
]);
62+
]));
6363

6464
foreach ($this->devices as $device) {
6565
$this->_send($device);

src/Drivers/APNs/Token.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class Token extends Driver
1717
/**
1818
* @var string
1919
*/
20-
protected $endpointSandbox = 'https://api.sandbox.push.apple.com/3/device/';
20+
protected $endpointSandbox = 'https://api.sandbox.push.apple.com/3/device/%s';
2121

2222
/**
2323
* @var string
2424
*/
25-
protected $endpointProduction = 'https://api.push.apple.com/3/device/';
25+
protected $endpointProduction = 'https://api.push.apple.com/3/device/%s';
2626

2727
/**
2828
* @var Feedback
@@ -54,9 +54,9 @@ public function __construct($options)
5454
*/
5555
public function send()
5656
{
57-
$this->httpClient = $this->getHttpClient([
57+
$this->httpClient = $this->getHttpClient(array_merge($this->options->httpOptions, [
5858
'version' => 2.0,
59-
]);
59+
]));
6060

6161
foreach ($this->devices as $device) {
6262
$this->_send($device);

src/Drivers/DriverOption.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ abstract class DriverOption implements DriverOptionInterface
1212
*/
1313
public $payload = [];
1414

15+
/**
16+
* Guzzle Request Options
17+
*
18+
* <https://docs.guzzlephp.org/en/stable/request-options.html>
19+
*
20+
* @var array
21+
*/
22+
public $httpOptions = [];
23+
1524
/**
1625
* @var string[][]
1726
*/

src/Drivers/FCM/Json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct($options)
5353
*/
5454
public function send()
5555
{
56-
$this->httpClient = $this->getHttpClient();
56+
$this->httpClient = $this->getHttpClient($this->options->httpOptions);
5757

5858
try {
5959
$options = [

src/Drivers/FCM/PlainText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct($options)
5757
*/
5858
public function send()
5959
{
60-
$this->httpClient = $this->getHttpClient();
60+
$this->httpClient = $this->getHttpClient($this->options->httpOptions);
6161

6262
foreach ($this->devices as $device) {
6363
$this->_send($device);

src/Drivers/FCM/V1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function send()
5959
'scopes' => 'https://www.googleapis.com/auth/firebase.messaging',
6060
]);
6161

62-
$this->httpClient = $client->authorize($this->getHttpClient());
62+
$this->httpClient = $client->authorize($this->getHttpClient($this->options->httpOptions));
6363

6464
foreach ($this->devices as $device) {
6565
$this->_send($device);

0 commit comments

Comments
 (0)