Getting Started
You can clone the repo with the following command:
git clone https://github.com/firebase/firebase-unity-sdk.git
The repository contains the Firebase Unity SDK source, with support for Android, iOS, and desktop platforms. Note that desktop is only supported for development purposes. It includes the following Firebase libraries:
Firebase is an app development platform with tools to help you build, grow and monetize your app. More information about Firebase can be found at https://firebase.google.com.
More information about the Firebase Unity SDK can be found at https://firebase.google.com/docs/unity/setup. Samples on how to use the Firebase Unity SDK can be found at https://github.com/firebase/quickstart-unity.
You can clone the repo with the following command:
git clone https://github.com/firebase/firebase-unity-sdk.git
Please follow Firebase C++ SDK Prerequisites first.
While installing through UnityHub, when you decide which version to install, it will pop up a dialog to select necessary support modules. Please check the boxes based on your dev machine OS and dev platform. For most common case while dev on macOS, we should select Android + Android SDK & NDK Tool, iOS Build Support and Mac Build Support (IL2CPP)
Under the repo root folder, call
python scripts/build_scripts/build_zips.py --platform=<target platform>
Note: Supported target platform names: linux,macos,windows,ios,android
Expected output artifact is [Repo Root]/<platform_unity, eg macos_unity>/firebase_unity-< version >-< platform >.zip
Note:
- Linux zip requires linux machine to build.
- Windows zip requires windows machine to build
- macOS, iOS and android zips can be built by mac.(Although android zip could be built on both linux and windows machine as well, but we recommend to run it with mac, to get align with our CI)
python scripts/build_scripts/build_zips.py --platform=<target platform> --targets=<lib1> --targets=<lib2>
Note: Supported library names: analytics, app_check, auth, crashlytics, database, dynamic_links, firestore, functions, installations, messaging, remote_config, storage
We can package the built artifacts to better imported by Unity Editor.
Copy the zip file for each platforms to one folder, referred to as assets_zip_dir below, for example usually looks like this
And then run:
python scripts/build_scripts/build_package.py --zip_dir=<assets_zip_dir> --output=<output dir>
With the same assets_zip_dir, we can run:
python scripts/build_scripts/build_package.py --zip_dir=<assets_zip_dir> --output=<output dir> --output_upm=True
If we build only certain subset of the libraries like in Building for certain library, we can copy the built artifacts into assets_zip_dir, and then run:
python scripts/build_scripts/build_package.py --zip_dir=<assets_zip_dir> --output=<output dir> --apis=<lib1,lib2>
We can refer to Firebase Unity Installation Options to learn how to import the unitypacakge or tgz files that packaged.