question

FatPanda avatar image
FatPanda asked

PEM private key problem

Hi, I´m trying to activate push notifications on IOS, I followed these steps Tutorial. But when I try to upload my PEM file in the game manager dashboard: Settings>Push Notifications> IOS Settings, I get a "Invalid parameter: Name Reason: An application with the same name but different properties already exists" error, so I tried using the Admin API call to setup notifications on IOS Link , but my API call results are always:

"code": 400,
 "status": "BadRequest",
 "error": "PushServiceError",
 "errorCode": 1095,
 "errorMessage": "End of list found where not expected",
 "CallBackTimeMS": 540

I assumed that in the API call, the "credential" parameter is the private key of the PEM file (?) (The ---BEGIN - END PRIVATE KEY---- chunk of code in my PEM file, I tried with and without the headers Begin-End). I don´t know what the error means.

In the first link (the tutorial) I used the generator to craft the Json for the API call, but the output is always:

Could not locate Private Key!

I copied the contents of my PEM file like it says in the page: "For iOS (APNS or APNS_SANDBOX), copy the complete contents of your PEM file below.", the result is always the same.

Maybe you can help me with guide on how to get the parameters of the PEM file or how a PEM file should look and what I need to make it work?

Thanks for the help!

Push Notifications
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

In the case of uploading via the Admin API, please ensure that you follow the directions in the documentation on adding "\n" at the end of each line and then removing all linefeeds. That's the most common cause of the second issue you saw.

The first issue is much easier to solve, however. The "already exists" error means that the Name you have your game set to already exists in SNS. Simply change the Name of your title in the Game Manager to something unique, and you should be able to register it with the PEM file.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

alex-1 avatar image
alex-1 answered

If you are having trouble exporting p12 from keychain this helped me. Then I was able to convert using the tutorial guide.

https://fluffy.es/keychain-cant-export-to-p12/

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.