APNs Provider API HTTP/2 using php, curl causes error on multiple push notifications sent
I tried your code and it works right on my machine. Nevertheless I see some differences between our verbose logs. The log of Try 1 is identical, but the log in Try 2 has some differences, this is mine:
...
Try 2 ================================================
* Found bundle for host api.development.push.apple.com: 0x7fe1b380e730 [can multiplex]
* Re-using existing connection! (#0) with host api.development.push.apple.com
* Connected to api.development.push.apple.com (17.172.238.203) port 443 (#0)
* Using Stream ID: 3 (easy handle 0x7fe1b305da00)
> POST /3/device/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX HTTP/1.1
Host: api.development.push.apple.com
Accept: */*
apns-topic: it.XXX.XXXXX
Content-Length: 43
Content-Type: application/x-www-form-urlencoded
* We are completely uploaded and fine
< HTTP/2.0 200
< apns-id:XXXXXXXXXXXXXXXXX
<
* Connection #0 to host api.development.push.apple.com left intact
I don't see in your log the text "Re-using existing connection!" ...
EDIT
The solution seems to be to downgrade curl to 7.47.1
Issuse with send notification with APNS HTTP/2 from PHP
Finally I found out problem. Each certificate have an identity, so with new certificate have new identity. If you don't check it in code PHP, Apple will return error above. If anyone work with it and face same error, they should check it.
Related Topics
Isset() Function Is Returning True Even When Item Is Not Set
Tracking Email with PHP and Image
How to Remove a Key and Its Value from an Associative Array
Examples of Vulnerable PHP Code
How to Post Multiple <Input Type="Checkbox" /> as Array in PHP
Displaying Multiple Lines of a File, Never Repeating
What Are the Benefits of Oo Programming? Will It Help Me Write Better Code
Best Way to Do a Weighted Search Over Multiple Fields in MySQL
Upload Multiple Images with Jquery Ajax and Process Them with PHP
Is This a PHP Date() Bug, or Is There Something Wrong with My Code
How to Convert Date/Time from 24-Hour Format to 12-Hour Am/Pm
MySQL Database Won't Start in Xampp Manager-Osx
How to Load Return Array from a PHP File
Fully Understanding Pdo Attr_Persistent
Wordwrap/Cut Text in HTML String