views:

322

answers:

2

I have spent a whole day on this already but still didn't go anywhere.

When I run my app in the development mode, I can get the push messages I send to myself thru PushMeBaby without a problem. However, when I try to test it in the production environment, I cannot get any push. I re-generated all the certificates and provisioning profiles, used the aps_production_identity.cer as the certificate for push, changed the ssl to gateway.push.apple.com, and did a release build for the app, but still couldn't get it to work. I found that in PushMeBaby, the line

result = SSLHandshake(context);

returns error -9844. Does it mean that something is wrong with the aps_production_identity.cer file?

This is driving me nuts, can somebody offer a little help?

Much appreciated!!!

A: 

Hello,

I'm facing the same issue, have you solved this problem?

Thank you

Reonarudo
Yes, I've solved this error. I lost a few days finding the solution. The problem is in the line: result = SSLSetPeerDomainName(context, "gateway.sandbox.push.apple.com", 30); NSLog(@"SSLSetPeerDomainName(): %d", result);You have to change the port to number 30. This solves the problem.I hope you can resolve the issue.Regards!
Marcelo
A: 

Yes, I've solved this error. I lost a few days finding the solution. The problem is in the line: result = SSLSetPeerDomainName(context, "gateway.sandbox.push.apple.com", 30); NSLog(@"SSLSetPeerDomainName(): %d", result);

You have to change the port to number 30. This solves the problem.

I hope you can resolve the issue.

Regards!

Marcelo
30 is not the port number! But the length of the domain string. So for "gateway.sandbox.push.apple.com" it is 30. But for "gateway.push.apple.com" it is 22...
Martijn Thé
Martijn, you ROCK!!!! Finally it works for me as well!!!!!
Stelian Iancu
I also thought that 30 was the port number :-). What a stupid mistake!!!
Stelian Iancu