File tree Expand file tree Collapse file tree 7 files changed +29
-10
lines changed Expand file tree Collapse file tree 7 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Release Notes
2
2
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
4
14
5
15
## [ v1.0.1 (2021-10-13)] ( https://github.com/sunaoka/push-notifications-php/compare/1.0.0...1.0.1 )
6
16
Original file line number Diff line number Diff line change @@ -53,13 +53,13 @@ public function __construct($options)
53
53
*/
54
54
public function send ()
55
55
{
56
- $ this ->httpClient = $ this ->getHttpClient ([
56
+ $ this ->httpClient = $ this ->getHttpClient (array_merge ( $ this -> options -> httpOptions , [
57
57
'version ' => 2.0 ,
58
58
'cert ' => [
59
59
$ this ->options ->certificate ,
60
60
$ this ->options ->password ,
61
61
],
62
- ]);
62
+ ])) ;
63
63
64
64
foreach ($ this ->devices as $ device ) {
65
65
$ this ->_send ($ device );
Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ class Token extends Driver
17
17
/**
18
18
* @var string
19
19
*/
20
- protected $ endpointSandbox = 'https://api.sandbox.push.apple.com/3/device/ ' ;
20
+ protected $ endpointSandbox = 'https://api.sandbox.push.apple.com/3/device/%s ' ;
21
21
22
22
/**
23
23
* @var string
24
24
*/
25
- protected $ endpointProduction = 'https://api.push.apple.com/3/device/ ' ;
25
+ protected $ endpointProduction = 'https://api.push.apple.com/3/device/%s ' ;
26
26
27
27
/**
28
28
* @var Feedback
@@ -54,9 +54,9 @@ public function __construct($options)
54
54
*/
55
55
public function send ()
56
56
{
57
- $ this ->httpClient = $ this ->getHttpClient ([
57
+ $ this ->httpClient = $ this ->getHttpClient (array_merge ( $ this -> options -> httpOptions , [
58
58
'version ' => 2.0 ,
59
- ]);
59
+ ])) ;
60
60
61
61
foreach ($ this ->devices as $ device ) {
62
62
$ this ->_send ($ device );
Original file line number Diff line number Diff line change @@ -12,6 +12,15 @@ abstract class DriverOption implements DriverOptionInterface
12
12
*/
13
13
public $ payload = [];
14
14
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
+
15
24
/**
16
25
* @var string[][]
17
26
*/
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function __construct($options)
53
53
*/
54
54
public function send ()
55
55
{
56
- $ this ->httpClient = $ this ->getHttpClient ();
56
+ $ this ->httpClient = $ this ->getHttpClient ($ this -> options -> httpOptions );
57
57
58
58
try {
59
59
$ options = [
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function __construct($options)
57
57
*/
58
58
public function send ()
59
59
{
60
- $ this ->httpClient = $ this ->getHttpClient ();
60
+ $ this ->httpClient = $ this ->getHttpClient ($ this -> options -> httpOptions );
61
61
62
62
foreach ($ this ->devices as $ device ) {
63
63
$ this ->_send ($ device );
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public function send()
59
59
'scopes ' => 'https://www.googleapis.com/auth/firebase.messaging ' ,
60
60
]);
61
61
62
- $ this ->httpClient = $ client ->authorize ($ this ->getHttpClient ());
62
+ $ this ->httpClient = $ client ->authorize ($ this ->getHttpClient ($ this -> options -> httpOptions ));
63
63
64
64
foreach ($ this ->devices as $ device ) {
65
65
$ this ->_send ($ device );
You can’t perform that action at this time.
0 commit comments