Push Notifications on iOS
Use this guide after you have created your Firebase project and replaced the iOS GoogleService-Info.plist file.
Quick Answer
iOS push requires APNs credentials in Firebase, Push Notifications capability in Xcode, a matching bundle identifier, notification permission at runtime, and testing on a real iOS device.
Official references:
1. Confirm the iOS App Identity
Make sure these values match:
- iOS bundle identifier in Xcode;
- iOS app registered in Firebase;
- Apple Developer App ID;
- provisioning profile used by Xcode.
If the bundle identifier changes, recreate or update the Firebase iOS app and download a fresh GoogleService-Info.plist.
2. Upload APNs Credentials to Firebase
In Firebase Console:
- Open Project Settings.
- Open Cloud Messaging.
- Select your iOS app.
- Upload your APNs authentication key or APNs certificate.
- Confirm the Team ID and Key ID match Apple Developer.
APNs authentication keys are usually easier to maintain than certificate-based setup because one key can support multiple apps in the same Apple Developer team.
3. Enable Native Capabilities
Open the iOS project in Xcode:
- Select the app target.
- Open Signing & Capabilities.
- Add Push Notifications.
- Add Background Modes if your app needs background notification handling.
- Select the correct development team and provisioning profile.
4. Install Pods and Rebuild
After changing Firebase config or iOS capabilities:
cd ios
bundle exec pod install
cd ..
yarn ios
5. Test on a Real Device
At minimum:
- Install the app on a real iPhone.
- Log in.
- Accept notification permission.
- Confirm the app saves an FCM token for the user.
- Trigger a notification from the app flow or backend.
- Confirm foreground, background, and terminated-state behavior.
- Confirm tapping the notification opens the expected screen if deep linking is implemented.
Troubleshooting
| Problem | Fix |
|---|---|
| iOS never receives an FCM token | Check APNs credentials in Firebase, bundle identifier, GoogleService-Info.plist, and real-device testing. |
| Permission prompt does not appear | Confirm the app requests notification permission and that permissions were not previously denied in Settings. |
| Android works but iOS does not | Check APNs authentication key, Team ID, Key ID, iOS bundle identifier, and Firebase iOS app mapping. |
| Works in debug but not TestFlight | Check production APNs credentials, provisioning profile, and release bundle identifier. |
| Notifications arrive but taps do nothing | Check notification payload data and navigation/deep-link handling. |