With this PHP code:
<?php
$apnsHost = 'gateway.sandbox.push.apple.com';
$apnsCert = 'apns-dev.pem';
$apnsPort = 2195;
$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);
$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);
$payload['aps'] = array('alert' => 'Oh hai!', 'badge' => 1, 'sound' => 'default');
$output = json_encode($payload);
$token = pack('H*', str_replace(' ', '', $token))
$apnsMessage = chr(0) . chr(0) . chr(32) . $token . chr(0) . chr(strlen($output)) . $output;
fwrite($apns, $apnsMessage);
socket_close($apns);
fclose($apns);
?>
you can send a push notification using PHP. From an AIR desktop client I can easily pass POST variables to a similar code and use AS3+PHP to send a notification.
The question: is it theoretically possible to do the same by only using AS3 and AIR (that is without PHP)? Has anyone tried? Aside from firewall issues, what could eventually cause problems? Thanks.