gorodezkiy
gorodezkiy

Reputation: 3417

Invalid token for some devices

given:

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:

Upvotes: 4

Views: 8097

Answers (2)

Valera Dubrava
Valera Dubrava

Reputation: 254

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

Upvotes: 0

ostergaard
ostergaard

Reputation: 3507

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.

Upvotes: 3

Related Questions