iOS Push Notifications with Moon APNS - works on local, but not on server side

938 views Asked by At

So, we were using Moon APNS for iOS push notifications and everything worked fine until recent. Firstly, Apple no longer supports ssl, so we changed to TLS instead.

Second thing is (and this is a really strange one), that if we invoke webservice on local computer to send push notification, everything works fine. But, when we publish this code to our testing server, push notifications are not delivered to the phone, but the code is exactly the same!

One other thing, after sendToApple method is called, we get OK status code, just notification doesn't come.

Any ideas?

1

There are 1 answers

3
markich On BEST ANSWER

I'm posting our solution, maybe someone has the same problem.

First of all, Moon APNS uses SSL encryption, but is deprecated by Apple. So you should alter Moon APNS library to use TLS instead. Second thing is, make sure you compile library with Newtonsoft JSON library version 6.0.0.0.

Our problem was, that we used older version of JSON library (I think the version was 4.x.x.x) and somewhere deep in the library exception occurred and returned 0 in sendToApple. Ironically, Apple uses 0 as status OK, so it was tricky to found out where the problem lies.