views:

16

answers:

0

Hi all,

I've got a problem when checking for a response error after sending a Push Notification. This is my setup:

From my PHP server, I'm sending Push Notifications. These notifications are send in the enhanced format, so I can get an error response from the Apple server. For example: Error #7 "Invalid payload size".

The way I check for errors is reading the socket response:

const ERROR_RESPONSE_SIZE = 6;
$errorResponse = @fread($this->_apnsSocket, self::ERROR_RESPONSE_SIZE);

This works fine when there is an actual error. By my problem is: when there's no error, the "fread" call doesn't return anything and keeps loading forever.

Can anyone help me with this? Thanks for your help!