What is Apple Push Notification service (APNs)?
This is a service that allows you to send push notifications to your application that are installed on Apple devices.
Before following this tutorial, you should have an iOS Firebase Certificate created in your Firebase account.
In this tutorial, you will first learn how to download an APNS Key file and after you will learn how to upload this file to your Firebase account.
APNS Key features:
Two keys max per team
One key can be used for all apps
How do I upload my APNs key to my Firebase project?
Step 1. Go to https://developer.apple.com and click Account
Step 2. Log in with your Apple Developer account
Step 3. Click on Certificates, IDs & Profiles
Step 4. Click on Keys and add a new key by clicking on the blue plus (+) icon next to the title Keys.
Step 5. On the next page, enter ‘APNS Key’ in the Key Name field and click the checkbox to enable Apple Push Notifications service (APNs)
Step 6. Click Register
Step 7. Click Download. This will download the APNs key that you will upload to Firebase. Please keep this page open to obtain the Key ID and Team ID for Firebase.
Note: Once the key has been downloaded, it cannot be retrieved again.
Step 8. Now that you have the APNS key downloaded, you will need to upload this to Firebase. Open up a new browser tab or window and navigate to https://console.firebase.google.com/
Note: The next few steps require you to have an iOS Firebase Certificate. If you have not done this yet, please check out our iOS Firebase Certificate article before continuing.
Step 9. Click on your App project
Step 10. On the top left, click on the gear icon on the right side of Project Overview and select Project Settings
Step 11. Click on the Cloud Messaging tab and in the Apple app configuration section, click Upload
Step 12. Here you will upload the key file by clicking Browse. Select the file that ends with .p8 that was downloaded in the previous steps. The file name will look like this: AuthKey_UN823KU9WJ.p8
Step 13. Now you will have to copy the Key ID and Team ID by going back to your Apple Developer account. The Key ID is located below the key name and the Team ID is located in the top right corner, next to your Apple developer name.
Step 14. Go back to the Firebase page and copy and paste the Key ID and Team ID. Lastly, click on the Upload button.
Congratulations! You've successfully created and uploaded your Apple APNS Key to your Firebase Certificate for iOS.
Have questions? No problem! Reach out to us and we'll be ready to help :)