Apple Push Notification Service APNS - Notifications not arriving?

I finally figured it out. I was using Sandbox with an AdHoc provisioning profile. Ad Hoc is apparently considered production instead of development.

I created the push production certificate, installed it and voila! It works.

Up vote 4 down vote favorite 3 share g+ share fb share tw.

I am trying to add push notifications to my app. I have am using an ad hoc profile. My appID does not have a wildcard.

I am using the following php code... $deviceToken="****";masked $time = time(); $apnsHost = 'gateway.sandbox.push.apple. Com'; $apnsPort = 2195; $apnsCert = 'apns-dev-maui. Pem'; $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); if($apns) { echo "Connection Established"; $payload = array(); $payload'aps' = array('alert' => 'It works!

', 'badge' => 1, 'sound' => 'default'); $payload = json_encode($payload); $apnsMessage = chr(0) . Chr(0) . Chr(32) .

Pack('H*', str_replace(' ', '', $deviceToken)) . Chr(0) . Chr(strlen($payload)) .

$payload; print "sending message :" . $apnsMessage . ""; print "sending payload :" .

$payload . ""; fwrite($apns, $apnsMessage); } else { echo "Connection Failed"; echo $errorString; echo $error; } // socket_close($apns); fclose($apns); No connection errors are generated. Nothing seems to be coming from the feedback channel.

I got the deviceTokens from the organizer console and an NSLog command. The notifications for this app are showing up in my settings menu. I have an ATT 3G and an old 2G that I use as an iPod.

Neither work. With no errors to look at, I am out of ideas. Anyone have any insight?

Jennifer php iphone push-notification apns link|improve this question edited Feb 18 '10 at 23:59Remus Rusanu94k957126 asked Feb 18 '10 at 23:57Mups36118.

Thanks. Was about to go completely bonkers! :) – Simon Whitaker Apr 18 '11 at 17:43.

Mups answer is right. I wanted to add an addition situation that had the same problem (in case its helpful to anyone else). I had push setup and it was working on exactly 1 iphone (not the others).

This was very puzzling. The issue was that the 1 iphone that worked had a 'debug' version of the program installed, where the others had an 'ad hoc' version installed. Our APNS server was setup to use the 'development' certificate and gateway.sandbox.push.apple.com I changed the certificate on the server to a 'production' certificate and the host to gateway.push.apple.com (then deleted all the provisioning profiles on all the devices, and installed 'ad hoc' version of the program) And we were good to go.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions