To send push notifications to iOS devices, you’ll need to generate an Apple Push Notification (APN) key in your Apple Developer account and upload it to Firebase.
Requirements:
An active Apple Developer account.
Access to your app in Firebase.
Your iOS app must already be created in Firebase.
How to set up your APN key
Go to developer.apple.com and log into your Apple Developer account.
In the top navigation, go to Certificates, IDs & Profiles.
Scroll down and click Keys in the left sidebar.
Click the + button to create a new key.
Check the box for Apple Push Notifications service (APNs).
Name your key something recognizable (e.g., "APN Key").
Click Continue, then Register.
On the confirmation page:
Note the Key ID — you'll need it later.
Download button a. Click Download and save the .p8 file to your computer. The .p8 file can only be downloaded once—store it securely.
In a new tab, go to console.firebase.google.com and open your Firebase project:
Click the gear icon next to Project Overview, then click Project Settings.
Go to the Cloud Messaging tab:
Scroll down to the iOS app configuration section.
Under APNs authentication key, click Upload.
Upload the .p8 file you downloaded from Apple.
Enter the Key ID and Team ID (Firebase may auto-detect your Team ID if you’ve done this before).
Click Upload to confirm.
Once the APN key is uploaded, click Publish to apply the changes.
Troubleshooting tips
Make sure you selected Sandbox and Production when creating your APN key.
If the Team ID isn’t auto-filled in Firebase, you can find it in your Apple Developer account under Membership details.