Stay organized with collectionsSave and categorize content based on your preferences.
Power up yourUnitygames with ourFirebaseUnitySDKs.
To show how easy it is to plug Firebase into your Unity project, we made a
sample game, MechaHamster. If you want to try out adding Firebase to a game, use
the starter version that's onGitHub. If you want a completed version, check
out the versions in theApp Storeor theGoogle PlayStore.
Find out more information about powering up your games with Firebase at ourFirebase games page.
Already added Firebase to your Unity project? Make sure that you're using the
latest version of theFirebaseUnitySDK.
Prerequisites
Install Unity 2021 LTS or later. Support for Unity 2020 is considered
deprecated, and will no longer be actively supported after the next major
release. Earlier versions may also be compatible but won't be actively
supported.
(Apple platforms only)Install the following:
Xcode 13.3.1 or higher
CocoaPods 1.12.0 or higher
Make sure that your Unity project meets these requirements:
For iOS— targets iOS 13 or higher
For tvOS- targets tvOS 13 or higher
For Android— targets API level 21
(Lollipop) or higher
Set up a physical device or use an emulator to run your app.
For Apple platforms— Set up a physical device or use an iOS or tvOS
simulator.
Do you want to useCloud Messaging?
ForCloud Messagingon iOS or tvOS, here are the prerequisites:
If you don't already have a Unity project and just want to try out a Firebase
product, you can download one of ourquickstart samples.
Step 1: Create a Firebase project
Before you can add Firebase to your Unity project, you need to create a Firebase
project to connect to your Unity project. VisitUnderstand Firebase Projectsto learn more about
Firebase projects.
In the center of the project overview page, click theUnityicon
(plat_unity)
to launch the setup workflow.
If you've already added an app to your Firebase project, clickAdd appto display the platform options.
Select which build target of your Unity project that you’d like to register,
or you can even select to register both targets now at the same time.
Enter your Unity project’s platform-specific ID(s).
For iOS— Enter your Unity project’s iOS ID in theiOS bundle
IDfield.
For Android— Enter your Unity project’s Android ID in theAndroid package
namefield. The termspackage nameandapplication IDare often used
interchangeably.
Where do you find your Unity project's ID?
Open your Unity project in your Unity IDE, then navigate to the settings
section for each platform:
For iOS— Navigate toBuild Settings > iOS.
For Android— Navigate toAndroid > Player Settings >
Other Settings.
Your Unity project's ID is theBundle Identifiervalue
(example ID:com.yourcompany.yourproject).
(Optional)Enter your Unity project’s platform-specific nickname(s). These nicknames are internal, convenience identifiers and are only visible
to you in theFirebaseconsole.
ClickRegister app.
Step 3: Add Firebase configuration files
Obtain your platform-specific Firebase configuration file(s) in theFirebaseconsole setup workflow.
For iOS— ClickDownload GoogleService-Info.plist.
For Android— ClickDownload google-services.json.
What do you need to know about this config file?
The Firebase config file contains unique, but non-secret identifiers for
your project and app. To learn more about this config file, visitUnderstand Firebase
Projects.
Add the Firebase package forGoogle Analytics:FirebaseAnalytics.unitypackage
Add the packages for any other Firebase products you want to use in
your app. For example, to useFirebase AuthenticationandFirebase Realtime Database: FirebaseAuth.unitypackageandFirebaseDatabase.unitypackage
Analyticsnot enabled
Add the packages for the Firebase products you want to use in your app.
For example, to useFirebase AuthenticationandFirebase Realtime Database: FirebaseAuth.unitypackageandFirebaseDatabase.unitypackage
In theImport Unity Packagewindow, clickImport.
Back in theFirebaseconsole, in the setup workflow, clickNext.
Step 5: Confirm Google Play services version requirements
Add the followingusingstatement and initialization code at the start of your
application. You can check for and optionally updateGoogle Playservicesto the
required version before calling any other methods in the SDK.
usingFirebase.Extensions;
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task=>{vardependencyStatus=task.Result;if(dependencyStatus==Firebase.DependencyStatus.Available){// Create and hold a reference to your FirebaseApp,// where app is a Firebase.FirebaseApp property of your application class.app=Firebase.FirebaseApp.DefaultInstance;// Set a flag here to indicate whether Firebase is ready to use by your app.}else{UnityEngine.Debug.LogError(System.String.Format("Could not resolve all Firebase dependencies: {0}",dependencyStatus));//FirebaseUnitySDK is not safe to use here.}});
You’re all set! Your Unity project is registered and configured to use Firebase.
When you're creating a game, it's often much easier to test your game in the
Unity editor and on desktop platforms first, then deploy and test on mobile
devices later in development. To support this workflow, we provide asubset of theFirebaseUnitySDKswhich can run
on Windows, macOS, Linux, and from within the Unity editor.
Set up a desktop-platform Unity project by following the same instructions as
for a mobile platform (start with theRegister your app with Firebasestep above).
Run your Unity project in the Unity IDE or select to build your Unity
project fordesktop.
(Optional)Run your Unity project in Edit Mode.
TheFirebaseUnitySDK can also be run in Unity's edit mode, allowing its use
in editor plugins.
When you create aFirebaseAppused by the editor, don't use the
default instance.
Instead, provide a unique name to theFirebaseApp.Create()call.
This is important to avoid a conflict in options between the instance used
by the Unity IDE and the instance used by your Unity project.
TheFirebaseUnitySDK includesdesktop workflow supportfor a subset of products, enabling certain parts of Firebase to be used in the
Unity editor and in standalone desktop builds on Windows, macOS, and Linux.
Firebase provides the remaining desktop libraries as stub (non-functional)
implementations for convenience when building for Windows, macOS, and Linux.
Therefore, you don't need to conditionally compile code to target the desktop.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,[]]