### Package Documentation Sources for Installations Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Collects and packages documentation sources for the Installations module, including generated SWIG sources. ```cmake unity_pack_documentation_sources(installations DOCUMENTATION_SOURCES ${firebase_installations_src} ${firebase_installations_swig_gen_src} ) ``` -------------------------------- ### Example Unity Settings Configuration Source: https://github.com/firebase/firebase-unity-sdk/blob/main/gha/unity/README.md An example demonstrating how to configure settings for Unity version 2020, including specific modules required for various platforms and build types. ```python UNITY_SETTINGS = { "2020": { WINDOWS: { "version": "2020.3.34f1", "changeset": "9a4c9c70452b", "modules": {ANDROID: ["android", "ios"], IOS: ["ios"], TVOS: ["appletv"], WINDOWS: [], MACOS: ["mac-mono"], LINUX: ["linux-mono"], PLAYMODE: ["ios"]}, }, ... }, } ``` -------------------------------- ### Package Firebase Installations C# Library for Unity Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Packages the C# library for Firebase Installations, preparing it for use within the Unity environment. ```cmake unity_pack_cs(firebase_installations_cs) ``` -------------------------------- ### Install Unity, Activate, and Release License Source: https://github.com/firebase/firebase-unity-sdk/blob/main/gha/unity/README.md This workflow demonstrates the complete process of installing Unity, activating a license using provided credentials, and then releasing the license. It's crucial to release the license after usage to free it up. ```yaml jobs: build_testapp: # ... steps: # ... - id: unity_setup_and_activate uses: ./gha/unity with: version: ${{ unity_version }} platforms: ${{ platforms }} username: ${{ secrets.UNITY_USERNAME }} password: ${{ secrets.UNITY_PASSWORD }} serial_ids: ${{ secrets.SERIAL_ID }} # ... - id: release_license uses: ./gha/unity with: version: ${{ unity_version }} release_license: "true" ``` -------------------------------- ### Define SWIG Input Files for Firebase Installations Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Sets the SWIG interface file for generating C# bindings for Firebase Installations. ```cmake set(firebase_installations_swig src/swig/installations.i ) ``` -------------------------------- ### Install Unity Without License Activation Source: https://github.com/firebase/firebase-unity-sdk/blob/main/gha/unity/README.md A basic workflow step to install a specified Unity version and supported platforms using the `unity-setup` action. This is suitable for scenarios where license activation is not required. ```yaml jobs: build_sdk: # ... steps: # ... - uses: ./gha/unity with: version: ${{ unity_version }} platforms: ${{ platforms }} ``` -------------------------------- ### iOS Packaging for Firebase Installations Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Conditionally packages the Firebase Installations library for iOS, specifying dependencies. ```cmake if(FIREBASE_IOS_BUILD) ios_pack(firebase_lib_installations libFirebaseCppInstallations DEPS firebase_installations firebase_installations_swig) else() build_firebase_shared( installations installations FirebaseCppInstallations ) endif() ``` -------------------------------- ### Add Mono Library for Firebase Installations C# Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Creates a Mono library for Firebase Installations C# bindings, specifying module, sources, references, and dependencies. ```cmake mono_add_library(firebase_installations_cs MODULE Firebase.Installations SOURCES ${firebase_installations_src} ${firebase_installations_swig_gen_src} REFERENCES ${FIREBASE_PLATFORM_REF} DEPENDS firebase_installations_swig ) ``` -------------------------------- ### Accessing Unity Version and Root Directory Outputs Source: https://github.com/firebase/firebase-unity-sdk/blob/main/gha/unity/README.md Demonstrates how to use the `UNITY_VERSION` and `UNITY_ROOT_DIR` environment variables provided by the action after it has run. These variables contain the full Unity version and the path to the Unity installation, respectively. ```yaml - uses: ./gha/unity with: version: ${{ unity_version }} platforms: ${{ platforms }} - run: echo '${{ env.UNITY_VERSION }}' echo '${{ env.UNITY_ROOT_DIR }}' ``` -------------------------------- ### Example Issue Reporting - Question Source: https://github.com/firebase/firebase-unity-sdk/blob/main/CONTRIBUTING.md When asking a question or reporting a problem, provide context about what you are trying to do, where you have looked for information, and where you expected to find it. ```markdown What are you trying to do or find out more about? Where have you looked? Where did you expect to find this information? ``` -------------------------------- ### Define CSharp Source Files for Firebase Installations Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Defines the C# source files for the Firebase Installations module. Currently empty, likely populated by SWIG generation. ```cmake set(firebase_installations_src ) ``` -------------------------------- ### Generate Dependencies XML for Firebase Installations Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Generates a dependencies XML file for Firebase Installations, specifying dependencies for Swift Package Manager, iOS, and Android. ```cmake if (FIREBASE_INCLUDE_UNITY) generate_dependencies_xml(Installations FIREBASE_SPM_DEPS "FirebaseInstallations|FirebaseInstallations" IOS_DEPS "FirebaseInstallations,${FIREBASE_INSTALLATIONS_POD_VERSION}" ANDROID_DEPS ${FIREBASE_INSTALLATIONS_ANDROID_DEPS} ANDROID_SPEC "installations" ) endif() ``` -------------------------------- ### Example Issue Reporting - Bug Template Source: https://github.com/firebase/firebase-unity-sdk/blob/main/CONTRIBUTING.md Use this template when submitting a bug report to help developers reproduce and fix the issue efficiently. Include operating system details, steps to reproduce, expected vs. actual results, and any other relevant information. ```markdown Operating system: Operating system version: What steps will reproduce the problem: 1. 2. 3. What is the expected result? What happens instead of that? Please provide any other information below, and attach a screenshot if possible. ``` -------------------------------- ### Add Firebase Installations SWIG Library Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Configures the SWIG library for Firebase Installations, specifying namespace, module name, source files, dependencies, and system dependencies. ```cmake firebase_swig_add_library(firebase_installations_swig NAMESPACE Firebase.Installations MODULE FirebaseCppInstallations SOURCES ${firebase_installations_swig} DEPENDS firebase_installations SYSTEM_DEPS ${EXTERNAL_LIB_NAMES} ) ``` -------------------------------- ### Set Folder Property for Firebase Installations C# Target Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/CMakeLists.txt Assigns the C# target for Firebase Installations to a specific folder within the Unity project structure. ```cmake set_property(TARGET firebase_installations_cs PROPERTY FOLDER "Firebase ${FIREBASE_PLATFORM_NAME}" ) ``` -------------------------------- ### Deploy Cloud Functions Source: https://github.com/firebase/firebase-unity-sdk/blob/main/functions/testapp/readme.md Commands to deploy Cloud Functions to your Firebase project. Ensure you have the Firebase CLI installed and navigate to the correct subdirectory. ```bash cd Assets/Firebase/Sample/Functions/.functions cd functions npm install cd .. firebase init functions firebase --project=YOUR_PROJECT_ID deploy --only functions ``` -------------------------------- ### Package SDK as tgz Archive Source: https://github.com/firebase/firebase-unity-sdk/blob/main/README.md Use this command to package the SDK into a tgz archive for distribution. Ensure you have specified the assets_zip_dir. ```bash python scripts/build_scripts/build_package.py --zip_dir= --output= --output_upm=True ``` -------------------------------- ### Pack Documentation Sources for Remote Config Source: https://github.com/firebase/firebase-unity-sdk/blob/main/remote_config/CMakeLists.txt Includes C# and SWIG interface files for documentation generation for the Remote Config module. ```cmake unity_pack_documentation_sources(remote_config DOCUMENTATION_SOURCES ${firebase_remote_config_src} ${firebase_remote_config_swig_gen_src} ) ``` -------------------------------- ### Generate SHA1 Key Source: https://github.com/firebase/firebase-unity-sdk/blob/main/installations/testapp/readme.md Use this command to generate a SHA1 key after setting the keystore in your Unity project. Replace `` and `` with your specific details. ```bash keytool -exportcert -list -v -alias -keystore ``` -------------------------------- ### Package Specific Libraries Source: https://github.com/firebase/firebase-unity-sdk/blob/main/README.md Build and package only a subset of libraries by specifying them with the --apis flag. Copy built artifacts into assets_zip_dir before running. ```bash python scripts/build_scripts/build_package.py --zip_dir= --output= --apis= ``` -------------------------------- ### Check out master branch Source: https://github.com/firebase/firebase-unity-sdk/blob/main/CONTRIBUTING.md Switch to the master branch locally. ```shell git checkout master -f ``` -------------------------------- ### Unity Settings Template Source: https://github.com/firebase/firebase-unity-sdk/blob/main/gha/unity/README.md Template for defining Unity versions, their changesets, and required modules for different platforms within the GitHub Action configuration. ```python UNITY_SETTINGS = { Major_version_number: { OS: { "version": Full_version_number, "changeset": Changeset, "modules": {Platform: [Moudles], ...}, }, ... }, } ``` -------------------------------- ### Build Firebase Unity SDK Zips Source: https://github.com/firebase/firebase-unity-sdk/blob/main/README.md Builds zip archives for the Firebase Unity SDK for a specified target platform. Ensure you are in the repo root folder when running this command. ```bash python scripts/build_scripts/build_zips.py --platform= ``` -------------------------------- ### Package Firebase Unity SDK Zips into Unitypackage Source: https://github.com/firebase/firebase-unity-sdk/blob/main/README.md Packages the built Firebase Unity SDK zip files into a format suitable for Unity Editor import. Ensure all platform zip files are in the specified directory. ```bash python scripts/build_scripts/build_package.py --zip_dir= --output= ``` -------------------------------- ### Build Specific Firebase Unity SDK Libraries Source: https://github.com/firebase/firebase-unity-sdk/blob/main/README.md Builds zip archives for specific Firebase Unity SDK libraries for a given target platform. You can specify multiple libraries using repeated --targets flags. ```bash python scripts/build_scripts/build_zips.py --platform= --targets= --targets= ``` -------------------------------- ### Add Mono Library for Firebase Remote Config Source: https://github.com/firebase/firebase-unity-sdk/blob/main/remote_config/CMakeLists.txt Creates a C# library for Firebase Remote Config, including its source files, platform references, and SWIG dependencies. ```cmake mono_add_library(firebase_remote_config_cs MODULE Firebase.RemoteConfig SOURCES ${firebase_remote_config_src} ${firebase_remote_config_swig_gen_src} REFERENCES ${FIREBASE_PLATFORM_REF} DEPENDS firebase_remote_config_swig ) ``` -------------------------------- ### Create Static Library for Firebase Crashlytics Source: https://github.com/firebase/firebase-unity-sdk/blob/main/crashlytics/src/cpp/CMakeLists.txt Creates a static library target named 'firebase_crashlytics' using the combined list of source files. ```cmake add_library(firebase_crashlytics STATIC ${firebase_crashlytics_cpp_src} ) ``` -------------------------------- ### Add Google MiniJson Library Source: https://github.com/firebase/firebase-unity-sdk/blob/main/external/CMakeLists.txt Configures the Google.MiniJson module, specifying its source file. This is used for JSON parsing within the SDK. ```cmake mono_add_library(google_minijson_cs MODULE Google.MiniJson SOURCES ${MINIJSON_SOURCE_DIR}/MiniJSON.cs ) ``` -------------------------------- ### Define C# Source Files for Remote Config Source: https://github.com/firebase/firebase-unity-sdk/blob/main/remote_config/CMakeLists.txt Lists the C# source files that constitute the Firebase Remote Config library. ```cmake set(firebase_remote_config_src src/ConfigInfo.cs src/ConfigSettings.cs src/ConfigUpdateEventArgs.cs src/ConfigValue.cs src/FirebaseRemoteConfig.cs src/RemoteConfigError.cs ) ``` -------------------------------- ### Define SWIG Input Files for Remote Config Source: https://github.com/firebase/firebase-unity-sdk/blob/main/remote_config/CMakeLists.txt Sets the list of SWIG interface files used for generating bindings for the Firebase Remote Config library. ```cmake set(firebase_remote_config_swig src/swig/remote_config.i ) ``` -------------------------------- ### Clone Firebase Unity SDK Repository Source: https://github.com/firebase/firebase-unity-sdk/blob/main/README.md Use this command to clone the Firebase Unity SDK source code from GitHub. ```bash git clone https://github.com/firebase/firebase-unity-sdk.git ``` -------------------------------- ### Configure Include Directories for Crashlytics Target Source: https://github.com/firebase/firebase-unity-sdk/blob/main/crashlytics/src/cpp/CMakeLists.txt Sets public and private include directories for the 'firebase_crashlytics' target. The public include is the local 'include' directory, while private includes point to SDK and Unity directories. ```cmake target_include_directories(firebase_crashlytics PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include PRIVATE ${FIREBASE_CPP_SDK_DIR} ${FIREBASE_UNITY_DIR} ) ``` -------------------------------- ### Pack XML Generation Scripts Source: https://github.com/firebase/firebase-unity-sdk/blob/main/external/CMakeLists.txt Packages the executable and script for generating XML from google-services.json. This is essential for Firebase configuration within Unity. ```cmake unity_pack_file( "${FIREBASE_CPP_SDK_DIR}/generate_xml_from_google_services_json.exe" PACK_PATH "Firebase/Editor" ) unity_pack_file( "${FIREBASE_CPP_SDK_DIR}/generate_xml_from_google_services_json.py" PACK_PATH "Firebase/Editor" ) ``` -------------------------------- ### Generate SHA1 Fingerprint for Android App Source: https://github.com/firebase/firebase-unity-sdk/blob/main/crashlytics/testapp/readme.md Use this command to generate the SHA1 fingerprint for your Android app's signing key. You need to replace `` and `` with your specific keystore path and key alias. ```bash keytool -list -v -keystore -alias ``` -------------------------------- ### Send Notification to Topic via Command Line Source: https://github.com/firebase/firebase-unity-sdk/blob/main/messaging/testapp/readme.md This cURL command allows sending a notification to all devices subscribed to a specific topic. Replace placeholders with your Server Key and the desired Topic. ```bash curl --header "Authorization: key=" --header "Content-Type: application/json" https://android.googleapis.com/gcm/send -d '{"notification":{"title":"Hi","body":"Hello from the Cloud"},"data":{"score":"lots"},"to":"/topics/"}' ``` -------------------------------- ### Send Notification to Single Device via Command Line Source: https://github.com/firebase/firebase-unity-sdk/blob/main/messaging/testapp/readme.md Use this cURL command to send a notification to a specific device using its registration token. Ensure you replace placeholders with your actual Server Key and Registration Token. ```bash curl --header "Authorization: key=" --header "Content-Type: application/json" https://android.googleapis.com/gcm/send -d '{"notification":{"title":"Hi","body":"Hello from the Cloud"},"data":{"score":"lots"},"to":""}' ``` -------------------------------- ### Pack C# Library for Unity Source: https://github.com/firebase/firebase-unity-sdk/blob/main/remote_config/CMakeLists.txt Packages the compiled C# library for use within the Unity game engine. ```cmake unity_pack_cs(firebase_remote_config_cs) ``` -------------------------------- ### Create a new git branch Source: https://github.com/firebase/firebase-unity-sdk/blob/main/CONTRIBUTING.md Before making changes, create a new git branch from the master branch. ```shell git checkout -b my-fix-branch master ``` -------------------------------- ### Rebase and force push for updates Source: https://github.com/firebase/firebase-unity-sdk/blob/main/CONTRIBUTING.md If changes are suggested, rebase your branch to the latest master and force push to update your pull request. ```shell git rebase master -i git push origin my-fix-branch -f ``` -------------------------------- ### Generate Dependencies XML for Unity Package Manager Source: https://github.com/firebase/firebase-unity-sdk/blob/main/remote_config/CMakeLists.txt Generates the dependencies.xml file for Unity's Package Manager, specifying dependencies for RemoteConfig across different platforms. ```cmake if (FIREBASE_INCLUDE_UNITY) generate_dependencies_xml(RemoteConfig FIREBASE_SPM_DEPS "FirebaseRemoteConfig|Firebase/RemoteConfig" IOS_DEPS "Firebase/RemoteConfig" ANDROID_DEPS ${FIREBASE_REMOTE_CONFIG_ANDROID_DEPS} ANDROID_SPEC "config" ) endif() ```