QuickBlox Developers (API docs, code samples, SDK)

How to create APNS certificates

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

Contents

Creating an App ID

Each iOS applications that uses the APNs must have a unique application ID that uniquely identifies itself. In this step, you will learn how to create an App ID for push notification.

  • 1. Log in to the iPhone Developer Connection Portal
  • 2. Click on the iOS Provisioning Portal on the right of the page:
  • Ios-dev-center-apple-developer.png

  • 3. You should see the welcome page:
  • IOS dev center home page.png

  • 4. Click on the App IDs tab on the left and then click on the New App ID button:
  • App-ids-ios-provisioning-portal-apple-developer.png

  • 5. Enter your app name for the Description. Enter Bundle Identifier. Ensure you have created an App ID without a wildcard. Wildcard IDs cannot use the push notification service. For example, our iOS application ID looks something like com.quickblox.messagestest. Click Submit:
  • Add-app-ids-ios-provisioning-portal-apple-developer.png

  • 6. You should now see the App ID that you have created:
  • CreatedAppID.png

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.

  • 7. Launch the Keychain Access application in your Mac OS X:
  • Keychainaccess.png

  • 8. Select Keychain Access -> Certificate Assistant -> Request a Certificate From a Certificate Authority:
  • Request sert.png

  • 9. Enter the information required and check the 'Saved to disk' option. Click Continue:
  • Savesert.png

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

  • 11. 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.

  • 12. To configure an App ID for push notification, you need to click the 'Configure' link displayed to the right of the App ID:
  • ConfigureAppID.png

  • 13. You will now see the option. Check the 'Enable for Apple Push Notification service' option and click the 'Configure' button displayed to the right of the Development Push SSL Certificate:
  • Enable APNS for app.png

  • 14. A wizard will appear. Click Continue:
  • Apn quide1.png

  • 15. Click the Choose File button to locate the Certificate Request file that you have saved earlier (Generating a Certificate Request section). Click Generate:
  • Apn quide2.png

  • 16. Your SSL Certificate will now be generated. Click Continue:
  • Apn quide3.png

  • 17. Click Done:
  • Apn quide4.png

  • 18. The same process above applies when generating the production certificate.

Make APNS certificates

  • 19. Now you can download certificate:
  • APN enabled.png

  • 20. The SSL Certificate that you download is named aps_developer_identity.cer. Double-click on it to install it in the Keychain Access application. The SSL certificate will be used by your provider application so that it can contact the APNs to send push notifications to your applications.
  • 21. Launch Keychain Assistant from your local Mac and from the 'login' keychain, filter by the 'Certificates' category. You will see an expandable option called “Apple Development iOS Push Services”:
  • New certs.png

  • 22. Expand this option then right click on “Apple Development iOS Push Services” -> Export “Apple Development iOS Push Services ...″. Save this as apns-dev-cert.p12 file somewhere you can access it.
  • Enter the password for exporting (it can be an empty):

    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

  • 23. Do the same again for the “Private Key” that was revealed when you expanded “Apple Development Push Services” ensuring you save it as apns-dev-key.p12 file.
  • 24. These files now need to be converted to the PEM format by executing this command from the terminal. You must necessarily set passphrase for key.
  • openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
    openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
    
  • 25. Than you need to remove the passphrase:
  • openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
    
  • 26. Finally, you need to combine the key and cert files into a apns-dev.pem file we will use when connecting to APNS:
  • cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem
    
  • 27. The same process above applies when generating the production certificate.

Conclusion

Thats all! Now you can upload APNS certificates to Messages module in QuickBlox Admin panel.

Back to Top