How to create APNS certificates

Ask tech team
From QuickBlox Developers (API docs, code samples, SDK)
Jump to: navigation, search

Contents

Creating an App ID

Each iOS application that uses the APNs must have a unique application ID that uniquely identifies itself. The following steps describe how to create an Apple App ID for your application.

If you already have an App ID you can skip the following steps.

  1. Log in to the Apple Developer Program Portal, Account section
  2. Click on the Certificates, Identifiers & Profiles:
  3. Selecting the module.png

  4. To make a new App ID open the App IDs menu section and click on the + button:
  5. Create AppID.png

  6. Enter your App ID Description Name (1), Bundle ID (2). Ensure you use Explicit App ID option. Click Continue:
  7. Inputing BundleID.png

  8. You should see now the info about App ID you are creating. Click Register button to finish.

Generating a Certificate Request

You must generate a certificate request file so that you can use it to request for a development SSL certificate later on.

  1. Launch the Keychain Access application in your macOS:
  2. Keychainaccess.png

  3. Select Keychain Access -> Certificate Assistant -> Request a Certificate From a Certificate Authority:
  4. Request sert.png

  5. Enter the information required and check the Saved to disk option. Then click Continue button:
  6. Savesert.png

  7. Save the certificate request using the suggested name and click Save. Click Done in the next screen:
  8. Savesertdesktope.png


    The same process above applies when generating the production certificate.

Configuring an App ID for Push Notifications

Once an App ID is created, you need to configure it for push notifications.

  1. To configure an App ID for push notification, you need to select the App in the App IDs list. Under Application Services click on the Edit button for the selected App ID:
  2. App settings.png

  3. Configuration page will appear. Scroll down to Push Notifications section. Enable checkbox **(1)** and click the Create Certificate (2) button:
  4. PushNotificationSettings.png

  5. A wizard will appear. Click Continue:
  6. CSR.png

  7. Click the Choose File button to locate the Certificate Request file that you have saved earlier (Generating a Certificate Request section). Click Generate:
  8. Generation certificate.png

  9. Your SSL Certificate will now be generated. Now you can click Download to download your certificate:
  10. Certificate is ready.png


    Also, you can download new certificate in Application Services list: DownloadCert.png


    The same process above applies when generating the production certificate.

Prepare APNS certificate

  1. The SSL Certificate that you download is named aps_developer_identity.cer. Double-click on it to install it into Keychain Access application. The SSL certificate will be used by QuickBlox application so that it can contact the APNs to send push notifications to your iOS application.
  2. Launch Keychain Access from your local Mac, then go to 'login' keychains and filter by the 'Certificates' category. You will see an expandable option called Apple Development iOS Push Services, paired with a private key:
  3. Keychain.png

  4. Right-click on your new push certificate and choose Export "Apple Development iOS Push Services .... Save this as apns-dev-cert.p12 file somewhere you can access it.
  5. Enter the password for exporting (optional):

    Enter the password for exporting.png

    Enter your usual admin password for your computer to confirm and finalize the export process:

    File-Enter your usual admin password.png


    The same process above applies when generating the production certificate.

Upload push certificate to QuickBlox Admin panel

Now you can upload your created APNS certificate to Push Notifications module in QuickBlox Admin panel.

  1. Go to Push notifications module:
  2. AdminPanel.png

  3. Switch to Settings tab
  4. QuickbloxSettings.png

  5. Upload your certificate

Create provision profile

Provisioning is the process of preparing and configuring an app to launch on devices and to use app services. During development, you choose which devices can run your app and which app services your app can access. A provisioning profile is downloaded from your developer account and embedded in the app bundle, and the entire bundle is code-signed. The embedded provisioning profile is installed on the device before the app is launched. If the information in the provisioning profile doesn’t match certain criteria, your app won’t launch.

  1. Log in to the Apple Developer Program Portal, Account section
  2. Click on the Certificates, Identifiers & Profiles:
  3. Selecting the module.png

  4. Open Provisioning Profiles menu section. Click on the + button:
  5. CreateProviision.png

  6. Select a type of the provisioning profile you need to create (1) and click on 'Continue' button to continue the creation:
  7. ChooseTypeOfProvision.png

  8. Select App ID you are creating the provisioning profile for:
  9. SelectAppIDforProvision.png

  10. Select the certificates you wish to include in this provisioning profile and click on 'Continue button':
  11. ChooseSertificateForProvision.png

  12. Select the devices you wish to include in this provisioning profile and click on 'Continue' button:
  13. SelecteDevices.png

  14. Input the Provisioning profile name and click on 'Generate' button to generate the profile:
  15. ProfileName.png

  16. Now you can download new Provision profile:
  17. ProvisionReady.png
    Also you can download this Provisioning profile later. Open a list with all Provisioning profiles and choose the required. Additional options become available:

    ListOfProfiles.png

  18. After click on 'Download' button the Provision profile will be downloaded to your hard disk. Double click on it to add to provisions library:
  19. HereISProvision.png

Configuring your iOS App for Push Notifications

  1. The first step is to change the App ID. Go to App Settings -> General and change Bundle Identifier to identifier that you type on Step 1
  2. SetAppID.png

  3. Then in the section named Singing (Debug or Release) select your Provision Profile:
  4. SetProvision.png

  5. Go to App Settings -> Capabilities and switch Push Notifications to On.
  6. PushNotificationsCapabilities.png

  7. Now you can run your application and play with Push Notifications. Make sure you use real iOS device, because push notifications will not work on simulator.