3

I am using APNS Sharp for sending push notification in IOS. I have successfully used that in development environment. But when app is live it no longer working. I have changed the push certificate to the Deployment certificate. And changed the code to point to apple server

push.RegisterAppleService(new ApplePushChannelSettings(true,appleCert, certificatePassword));

I am not getting any error back. But the device is not getting any notifications. Here I am trying to send notification to a single device.

How can I do this properly?

Thanks

Zach
  • 9,989
  • 19
  • 70
  • 107
  • 1
    Are you sure you are using a production device token? – Eran May 08 '13 at 16:51
  • Is your firewall blocking the APNS messages to the production environment at Apple? – CSmith May 08 '13 at 17:29
  • @Zach, did you make it work? I am having the same problem =( – Ezeki May 10 '13 at 15:01
  • @Ezeki Yes its started working for me. I was sending development token. Thats the reason. – Zach May 11 '13 at 13:48
  • Solution For This Question refer the link http://stackoverflow.com/questions/23329040/pushsharp-apns-production-the-credentials-supplied-to-the-package-were-not-reco?rq=1 – Elangovan Aug 06 '15 at 12:39
  • A certificate crested for development wont work for production. Make sure you use the right one. – MosheG Nov 23 '15 at 16:50

1 Answers1

1

I've figured the problem. I've revoked and regenerated the certificate again, and this time, I've only exported the private key (without the certificate) in Keychain access, exported as .p12 and used the new file, and it worked. For some reason, PushSharp wasn't playing well with .p12 when both certificate and private key was present in the file.

Elangovan
  • 1,158
  • 1
  • 9
  • 26
  • A .p12 (PKCS #12) has key and one or more certs. You can see both if you convert back to text (pem). openssl pkcs12 -in apns.p12 -passin 'pass:mypass' -passout 'pass:' -nodes -clcerts >apns.pem I've read elsewhere that exporting from the top node uses the public key. https://stackoverflow.com/questions/15662377/unable-to-export-apple-production-push-ssl-certificate-in-p12-format/34472980#34472980 You check validity of the pem against Apple's server with openssl: https://support.pubnub.com/support/solutions/articles/14000043600-how-do-i-test-my-pem-key- – johnk73 Jan 26 '18 at 19:43