I use this Ruby code to get APN errors on failed clicks:
if IO.select([ssl], nil, nil, 5) read_buffer = ssl.read(6) process_error_response(read_buffer) end
I noticed a strange situation where IO.select is not zero, but read_buffer returns an empty string. After some debugging, I realized that this happens if you connect to gateway.push.apple.com with a development APN certificate, and the same thing happens if you connect to gateway.sandbox.push.apple.com with a production certificate.
Is there a way to programmatically determine what it is, for example. if you received a push certificate from the user and said that it’s production / development, but can’t check this fact on the Apple developer’s website? I would have thought that the connection would be rejected, but instead it would be created, but in a partially broken state.
source share