Reputation: 2392
Is there a way to programmatically generate the Apple Push Notification Service (APNS) certificate? I'd like to write a script that automatically renews our APNS certificate every year by creating a new one and uploading it to our server.
Upvotes: 4
Views: 1349
Reputation: 18346
I believe you can use some automation tools to do it
If we look at APNS certificate generation guide https://developers.connectycube.com/ios/how-to-create-apns-certificate - we can see that we need some automation for Web and Desktop tasks
For Web we can use Selenium IDE. For Desktop we can use Apple Automator
I believe we can write scripts for both and then combine into single bash run script
Also, there is a fastlane pem generator that also can be used for such purpose
I recommend to think twice before start doing it - it's only need to be done once per year, so maybe it's faster to do so manually than spend time for building such a script :)
Upvotes: 2
Reputation: 21
In your scenario you may no longer need to re-generate certificates every year if your server supports APNS token-based authentication with .p8 token files: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns
Upvotes: 0