protected function _getBinaryNotification($sDeviceToken, $sPayload, $nMessageID = 0, $nExpire = 604800)
	{
		$nTokenLength = strlen($sDeviceToken);
		$nPayloadLength = strlen($sPayload);

		$sRet  = pack('CNNnH*', self::COMMAND_PUSH, $nMessageID, $nExpire > 0 ? time() + $nExpire : 0, self::DEVICE_BINARY_SIZE, $sDeviceToken);
		$sRet .= pack('n', $nPayloadLength);
		$sRet .= $sPayload;

		return $sRet;
	}
protected function _getBinaryNotification($sDeviceToken, $sPayload, $nMessageID = 0, $nExpire = 604800)
	{
		$nTokenLength = strlen($sDeviceToken);
		$nPayloadLength = strlen($sPayload);

		$sRet  = pack('CNNnH*', self::COMMAND_PUSH, $nMessageID, $nExpire > 0 ? time() + $nExpire : 0, self::DEVICE_BINARY_SIZE, $sDeviceToken);
		$sRet .= pack('n', $nPayloadLength);
		$sRet .= $sPayload;

		return $sRet;
	}
protected function _getBinaryNotification ( $ sDeviceToken , $ sPayload , $ nMessageID = 0 , $ nExpire = 604800 ) { $ nTokenLength = strlen ( $ sDeviceToken ) ; $ nPayloadLength = strlen ( $ sPayload ) ; $ sRet = pack ( 'CNNnH*' , self :: COMMAND_PUSH , $ nMessageID , $ nExpire > 0 ? time ( ) + $ nExpire : 0 , self :: DEVICE_BINARY_SIZE , $ sDeviceToken ) ; $ sRet .= pack ( 'n' , $ nPayloadLength ) ; $ sRet .= $ sPayload ; return $ sRet ; }
Generate a binary notification from a device token and a JSON-encoded payload.

@see http://tinyurl.com/ApplePushNotificationBinary

@param  $sDeviceToken @type string The device token.
@param  $sPayload @type string The JSON-encoded payload.
@param  $nMessageID @type integer @optional Message unique ID.
@param  $nExpire @type integer @optional Seconds, starting from now, that
identifies when the notification is no longer valid and can be discarded.
Pass a negative value (-1 for example) to request that APNs not store
the notification at all. Default is 86400 * 7, 7 days.
@return @type string A binary notification.
Generate a binary notification from a device token and a JSON - encoded payload .