iOS APNS through Amazon SNS and Unity - Cannot cre

2019-05-09 05:34发布

问题:

I'm trying to set up push notifications through Amazon SNS in Unity.

I have the Android side of things working perfectly but we're having issues with iOS. I am able to get the device to register to a Apple Production SNS application and subscribe to a topic but as soon as I attempt to send a notification the endpoints "Enabled" status becomes "False".

I read that this could be due to the certificate being set as Production although we followed the instructions on creating a Development certificate, when I try uploading the .p12 file to create an Apple Development platform in SNS it always gives an error saying:

"You provided a certificate of type iOS Production"

We have tried multiple times to download the development certificate and tried rebuilding the app with a new bundle ID and new app on the Apple development site without touching the production button but it always ends up being a production certificate after exporting the .p12 from KeyChain...

Also, every .p12 we have created had the exact private key and certificate as the last.

What could be going wrong?

回答1:

This Worked for Me:

1 - Download the Certificate from Apple (APNS Certificate for Development or Production)

2 - Double click on your Certificate to open it in your KeyChain

3 - Select it, Right-Click on it and press EXPORT "Cer" *** DO NOT SELECT IT TOGETHER WITH YOUR PRIVATE KEY, Select it By ITSELF!

4 - Name your new p12 and Upload this to SNS in the Setup Stage

DONE, this will work!

---> Its weird that Amazon's SNS requires a NON-Signed .p12 instead of the Combined .p12 (including private key) like other platforms, but... Go Discuss with Amazon...



回答2:

This worked for me;

Follow the steps in this guide;

http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html

Now in SNS when creating DO NOT upload the p12.

Open up the files generated in step 2 & 3 in a text editor.

Copy the certificate from the .pem generated in step 2 into the certificate text area.

Copy the private key from the .pem generated in step 3 to the private key text area.

It should create. My guess is that some old certificate was being tagged along in my .p12 file.