Docs Firebase setup
iOS push notifications: add your Apple push key to Firebase
iPhones only get push notifications through the Apple Push Notification service (APNs). Give Firebase your APNs key once, and iOS push notifications just work.
6 min read
All guides
- Get started with PusherHub
- Create a Firebase project
- Get your Firebase service account file
- Find your Sender ID
- iOS push notifications: add your Apple push key to Firebase
- Add push notifications to your app
- Flutter
- Android (Kotlin)
- Java
- React Native
- iOS (Swift)
- Unity
- Send a test push notification
- Send your first push notification
Create an APNs key at Apple
- Sign in at developer.apple.com/account and open Certificates, Identifiers & Profiles Keys .
- Click the + button.
- Name the key — "Push notifications" is fine. Apple doesn't allow special characters such as
@or&in the name. - Tick Apple Push Notifications service (APNs), then click Configure next to it.
- Set Environment to Sandbox & Production, so the key works for test builds and App Store builds. Leave Key Restriction as Team Scoped (All Topics).
- Click Save, then Continue and Register.
Download the key, and note two IDs
Click Download. You get a file named like AuthKey_AB12CD34EF.p8.
Write down:
- the Key ID — the 10 characters on the key's page (and in the file name);
- your Team ID — under your name at the top right of the developer account, or in Membership details.
Upload it to Firebase
- In the Firebase console, open Settings General from the menu on the left, then the Cloud Messaging tab.
- Under Apple app configuration, pick your iOS app.
- Under APNs Authentication Key there are two rows — development and production. Click Upload on one of them.
- Choose the
.p8file, type the Key ID and Team ID, and click Upload. - Do the same on the other row, with the same
.p8file and IDs — a Sandbox & Production key covers both.
Turn on push notifications in Xcode
In Xcode, select your app's target and open Signing & Capabilities:
- click + Capability and add Push Notifications;
- click + Capability again, add Background Modes, and tick Remote notifications.
Your app's SDK Integration tab in PusherHub walks you through the rest — see Add push notifications to your app.