4
votes

given:

  • working iPod application
  • The server side in php (modified easyapns).

I'm sending requests in the sandbox ssl://gateway.sandbox.push.apple.com:2195 If I'm sending a request to ssl://gateway.push.apple.com:2195, no errors returned, but the notification did not reach. In this case if I'm sending totally wrong device token (e.g. 12345), the APNs still didn't return error.

Problem: APN returns status_code => 8 (for explanation of the docks: Invalid token) to the inquiry Enhanced notification format, and returns an error code for a 4 out of 5 tokens with 5 devices.

I have correct dev crtificate, at least so says iPod's app developer which sent that certificate to me. And the iPod's app developer argues that application is sending correct dev token each time (I don't know how to check device token without mac and developer tools).

Checked:

  • The server ports 2195,2196 are open
  • My router settings through which iPod connected to the network is correct (and port 5223 for receiving is open) - I tested on "iPusher" and "iPush test" apps
  • Connection to the APN is successful
  • Tried to send from the local machine
  • Tried to send from the VPS
  • Checked
2
Are you storing the token somewhere so that there could be some issue with that part? - Joachim Isaksson
Currently while testing it hardcoded directly in the php code. And I didn't write it, just copy/paste that which was sent to server by iPod application. - gorodezkiy
You're using the live certificate and live tokens when talking to the live APN server, right? - mattjgalloway
No, I'm using correct dev certificate, at least so says iPod's app developer which sent that certificate to me. And the iPod's app developer argues that application is sending correct dev token each time (I don't know how to check device token without mac and developer tools). You may be confused by fact that I try to request production url, but this was due to despair. - gorodezkiy

2 Answers

3
votes

When I had this problem it turned out to be because the key and cert didn't match. Try connecting using openssl:

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert cert.pem -key key.pem

Until that spews out a pile of stuff starting with 'CONNECTED' you're not connecting properly.

0
votes

We are faced with the same problem. The problem was in provision profile: it was production, but for sandbox it must be development. More description we found in This comment