Create the items related to the developer account with which you are going to publish
You have to create a CSR file and an iOS Distribution certificate. And you will be able to use these items for all of the next apps you will have to publish under this developer account ā keep them preciously once created.
The CSR file:
It must be created from the keychain access tool of your Mac. Open it from Applications > Utilities > Keychain Access:

From the menu select āKeychain accessā > āCertificate Assistantā > āRequest a Certificate From a Certificate Authorityā:

In the window that opens, enter the email of the developer account (or any other email address, it doesnāt have any impact), and enter the name of your developer account, and select āSaved to diskā:

Save this CSR to your disk, in a folder related to the certificates of your developer account.
Close the window.
The iOS Distribution certificate:
ā Connect at https://developer.apple.com/membercenter/index.action with the developer account
ā Click on āCertificates, Identifiers & Profilesā
ā Click on āProductionā which in the main āCertificatesā menu in the menu on the left:

ā Then click on from the upper right
ā Choose āApp Store and Ad Hocā and click on ācontinueā:

ā Click on āContinueā again
ā Sign your iOS Distribution certificate with the CSR file you have created before.
ā Download the iOS Distribution certificate that has been created.
ā Double click on the iOS Distribution certificate (ios_distribution.cer) to add it to the Keychain Access.
Create the items related to the app you are going to publish
The APS Production Certificate:
Thanks to this certificate you will be able to add push notifications, in-app purchase, and other services to your app. In our case, only the push notification service is interesting.
ā Click on āApp IDsā from the āIdentifiersā menu on the left:
ā Click on from the upper right
ā Enter your app name, and the bundle id of the app:

ā Go below and select āPush Notificationsā in the list of āApp Servicesā:

ā Click on āContinueā
ā Click on āRegisterā and click on āDoneā
ā Then in the list, find the app id you have just created and click on āEditā

ā Go at the bottom and in Push Notifications, in the āProduction SSL Certificateā section click on āCreate Certificateā

ā Click on āContinueā
ā Click on āChoose Fileā and upload the CSR file you have created before for this developer account (the same CSR you have used to create the iOS Distribution certificate for this developer account)

ā Download the Apple Push Services certificate (aps.cer) that has just been created. Store this certificate in a folder related to this app on your Mac.

ā Click on āDoneā
-Double click on the Apple Push Services certificate (aps.cer) to add it to the Keychain Access.
The Provisioning File
ā click on āDistributionā from āProvisionning Profilesā on the left menu:

ā Click on from the upper right
ā Choose āApp Storeā under āDistributionā:

ā Select the app ID of your app, and click on āContinueā

ā Select the iOS Distribution certificate associated to the CSR you have used to sign the Apple Push Services Certificate you have created just before (it is very important to use the iOS Distribution which has been created with the CSR used to sign the aps.cer of this app. Donāt forget it, and donāt forget that in case you create a new aps.cer for this app with another CSR you will have to create a new provisionning profile too with the iOS Distribution certificate made with this CSR, and then to publish an update of your app on the App Store).

ā Click on āContinueā
ā Name the provisionning profile and click on āContinueā

ā Download the provisionning profile that has just been created. Store this certificate in the folder related to this app on your Mac, and which contains the Apple Push Services certificate created just before.

Compiling the app
ā Download your iOS source code
ā Unzip the folder and open the .xcworkspace file by double-clicking it
ā Follow this video:
Creating The .pem Certificate
ā Go in the Keychain Access on your Mac
ā From the left menu, select āCertificatesā

ā In the search bar at the upper right, enter the bundle ID of your app
ā Click on the arrow on the left of your āApple Push Servicesā certificate, a private key must be attached under it

ā Select the private key and the certificate
ā Right-click on them
ā Select āExport 2 itemsā¦ā

ā Choose your desktop as the destination (it can be another location but you will have to adjust the code we will give you after)

ā Choose a password of your own

ā Open the Terminal console of your Mac (From Applications > Utilities > Terminal)
ā In the Terminal, be sure to be located on your desktop (you must have āDesktopā displayed and then your username)

ā Enter this command:
āopenssl pkcs12 -in Certificates.p12 -out certificat.pem -nodes -clcertsā
(If the terminal answers that there is no file named āCertificates.p12ā, go on your desktop and check what is the name of this certificate .p12, and enter this name rather than Certificates.p12 in the command line)

ā Enter the password you have used just before to export your certificate on your desktop

ā On your desktop you have now two certificates: a Certificates.p12 and a certificat.pem.

ā Move these files to the folder of your app on your Mac (with the provisionning profile and the aps.cer)
Send us the certificat.pem file upon request.
IMPORTANT NOTE:
Your .pem certificate must be well created and must contain 4 sections:
ā friendlyName: Apple Push Services
ā friendlyName: iPhone Distribution
ā And then two sections about keys with āKey Attributes: ā
If your .pem doesnāt contain these sections that means you have missed something and it will not work.