I used this great blog post to try and get Apple Push notifications from my server. The connection seems to work just fine, and I can write to it. However, no notice has been received. To try and debug it, I would like to create an “extended notification” that will cause the APNS server to return an error code before shutting down. However, I'm not sure how to create data to send to the server using PHP.
Currently, for normal notification, I use according to the instructions:
$apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $deviceToken)) . chr(0) . chr(strlen($payload)) . $payload;
This creates a request in the format:

However, I need a request in the format:

Where, according to the documentation:
- , . error-response, APN .
- UNIX, (UTC), , . expiry (big endian). , APN . , , APN .
!