This guide explains how to configure Apple Push Notification Service (APNs) and Firebase Cloud Messaging (FCM) for Unity iOS projects. Proper configuration ensures that your Unity game can deliver push notifications to iPhone and iPad users.
Before starting, make sure you have:
- Unity 2021 LTS or newer
- macOS
- Xcode (latest version)
- Apple Developer Account
- Firebase Project
- Firebase Unity SDK
- Physical iPhone or iPad for testing
Push notifications cannot be fully tested in the Unity Editor.
Open the Firebase Console.
- Select your Firebase project.
- Click Add App.
- Choose iOS.
- Enter your Bundle Identifier.
- Register the application.
Example Bundle Identifier:
com.company.mygame
The Bundle Identifier must exactly match the value used in your Unity project.
Download:
GoogleService-Info.plist
Copy it into your Unity project.
Example:
Assets/
GoogleService-Info.plist
Firebase automatically reads this configuration when the application starts.
Log in to the Apple Developer portal.
Enable:
- Push Notifications
- App ID
- Apple Push Notification Service (APNs)
Generate the required certificates or authentication key.
These credentials allow Firebase to communicate with Apple's notification servers.
Open Firebase Console.
Navigate to:
Project Settings
↓
Cloud Messaging
Upload either:
- APNs Authentication Key (.p8)
or
- APNs Certificate
Once uploaded, Firebase can deliver notifications to iOS devices.
Open:
Build Settings
↓
iOS
Configure:
- Bundle Identifier
- Target iOS Version
- Architecture
- Signing Team (inside Xcode)
Ensure the Bundle Identifier matches Firebase exactly.
Build your Unity project for iOS.
Open the generated Xcode project.
Inside Xcode enable:
- Push Notifications
- Background Modes
- Remote Notifications
These capabilities are required for receiving push notifications.
Unlike Android, iOS always requires user permission before notifications can be displayed.
Request permission at an appropriate moment.
Examples:
- After the tutorial
- After completing Level 1
- Before Daily Rewards
Avoid requesting permission immediately when the game launches.
When Firebase initializes successfully, iOS generates a device token.
Workflow:
Unity Game
↓
Firebase SDK
↓
APNs
↓
Device Token
↓
Firebase Registration Token
This token allows Firebase to identify the player's device.
Open Firebase Console.
Go to:
Messaging
↓
Create Notification
Send a test notification to your iPhone.
Verify:
- Notification appears.
- App launches correctly.
- Notification data is received.
- Deep links work as expected.
If notifications fail on iOS, check:
- Incorrect Bundle Identifier
- Missing GoogleService-Info.plist
- APNs not configured
- Push Notifications capability disabled
- Background Modes disabled
- Notification permission denied
- Incorrect Apple Developer configuration
Most issues originate from APNs configuration rather than Unity.
To improve reliability:
- Test on physical iPhone devices.
- Keep Firebase SDK updated.
- Keep Xcode updated.
- Handle notification permission carefully.
- Monitor APNs configuration after certificate renewal.
- Use meaningful notification messages.
| Android | iOS |
|---|---|
| Uses Firebase directly | Uses APNs through Firebase |
| google-services.json | GoogleService-Info.plist |
| Notification Channels | Notification Categories |
| Google Play Services | Apple Push Notification Service |
Although both platforms use Firebase Cloud Messaging, their setup process differs.
Configuring push notifications on iOS requires Firebase, Apple Push Notification Service (APNs), and the correct Xcode capabilities. Once configured, Unity games can reliably deliver notifications to iPhone and iPad users.
➡ Unity C# Example
Learn how to initialize Firebase Messaging, receive notifications, and handle notification events in Unity using C#.