Rotem Yakov
Rotem Yakov

Reputation: 301

Universal certificate works for production but not development

I generated a universal push certificate ("Apple Push Notification service SSL (Sandbox & Production)"), which works correctly on production (enterprise distribution).

However, when I use it with a development app (when I install it from Xcode) it doesn't work, and I get the error "The credentials supplied to the package were not recognized" (a PushSharp error).

My old development-only certificate does work.

Any ideas?

Upvotes: 0

Views: 501

Answers (2)

Rotem Yakov
Rotem Yakov

Reputation: 301

Solved it.

My problem was pretty silly - I had a check in the code if the certificate is production or development. It returned 'production' because universal certificate matches the condition there.

Then it tried to treat it as a production app when it wasn't.

My second problem was that PushSharp requires the .p12 file to be exported only from the private key (select only the private key in the KeyChain and select "Export"), while Apple instruct to select both the certificate and the private key to export the .p12.

Upvotes: 0

ron27
ron27

Reputation: 181

When you take build from Xcode, it will treat the app as development build and will use only the development certificates for app and APNS.

If you want to test the production APNS certficate you need to take an Adhoc build.

Upvotes: 0

Related Questions