From 510dd82bad2f4dabf80580c2d636648e2e7da75b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 13:47:02 +0000 Subject: [PATCH 1/8] docs: Revise Jules.md for AI agent and add SDK setup This commit revises the `Jules.md` onboarding guide based on user feedback. The guide is now tailored for an AI coding agent, with the following changes: - Removed instructions related to manual repository cloning and Android Studio. - Added a new "Environment Setup" section with instructions for installing the Android SDK using the `sdkmanager` command-line tool. - Adjusted the language throughout the document to be more direct and command-oriented. --- Jules.md | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Jules.md diff --git a/Jules.md b/Jules.md new file mode 100644 index 00000000000..40be14fceef --- /dev/null +++ b/Jules.md @@ -0,0 +1,105 @@ +# Jules Onboarding Guide for `firebase-android-sdk` + +This guide provides essential information for working within the `firebase-android-sdk` repository. + +## Table of Contents +- [Environment Setup](#environment-setup) +- [Testing](#testing) +- [API Surface](#api-surface) +- [Best Practices](#best-practices) +- [Common Patterns](#common-patterns) +- [External Dependencies](#external-dependencies) +- [Updating this Guide](#updating-this-guide) + +--- + +## Environment Setup + +To work with this repository, the Android SDK must be installed. Use the `sdkmanager` command-line tool for this purpose. + +1. **Install Android SDK Command-Line Tools**: + - If not already installed, download the command-line tools from the [Android Studio page](https://developer.android.com/studio#command-line-tools-only). + - Create a directory for the Android SDK, e.g., `android_sdk`. + - Unzip the downloaded package and move the `cmdline-tools` directory into the `android_sdk` directory. + - The final structure should be `android_sdk/cmdline-tools/`. + +2. **Install required SDK packages**: + - Use `sdkmanager` to install the necessary platforms, build tools, and other packages. For example: + ```bash + # List all available packages + sdkmanager --list + + # Install platform tools and the SDK for API level 33 + sdkmanager "platform-tools" "platforms;android-33" + + # Accept all licenses + sdkmanager --licenses + ``` + - Refer to the specific requirements of the project to determine which packages to install. + +3. **Configure for integration tests**: + - To run integration tests, a `google-services.json` file is required. + - Place this file in the root of the repository. + +--- + +## Testing + +This repository uses two main types of tests: + +1. **Unit Tests**: + - These tests run on the local JVM. + - To execute unit tests for a specific project, run: + ```bash + ./gradlew ::check + ``` + +2. **Integration Tests**: + - These tests run on a hardware device or emulator. + - Ensure a `google-services.json` file is present in the repository root. + - To execute integration tests for a specific project, run: + ```bash + ./gradlew ::connectedCheck + ``` + +--- + +## API Surface + +The public API of the Firebase SDKs is managed using a set of annotations: + +- `@PublicApi`: Marks APIs that are intended for public consumption by developers. +- `@KeepForSdk`: Marks APIs that are intended for use by other Firebase SDKs. These APIs will trigger a linter error if used by developers outside of a Firebase package. +- `@Keep`: Marks APIs that need to be preserved at runtime, usually due to reflection. This annotation should be used sparingly as it prevents the code from being proguarded. + +--- + +## Best Practices + +- **Code Formatting**: The repository uses `spotless` for code formatting. To format the code in a specific project, run: + ```bash + ./gradlew ::spotlessApply + ``` +- **Dependency Management**: Dependencies are managed using Gradle. Be mindful of the impact of new dependencies on the size of the SDKs. + +--- + +## Common Patterns + +This repository uses a combination of dependency injection frameworks: + +- **`firebase-components`**: This is a custom dependency injection framework used for discovery and dependency injection between different Firebase SDKs. It allows SDKs to register their components and declare dependencies on other components. The initialization is managed by `FirebaseApp`. + +- **Dagger**: Dagger is used for internal dependency injection within individual SDKs. This helps to create more testable and maintainable code. Dagger components are typically instantiated within the `ComponentRegistrar` of an SDK, which allows for the injection of dependencies from `firebase-components` into the Dagger graph. + +--- + +## External Dependencies + +Do not add new external dependencies to the project unless explicitly asked to do so. The Firebase SDKs are designed to be lightweight, and adding new dependencies can increase the size of the final artifacts. + +--- + +## Updating this Guide + +If new patterns or conventions are discovered, update this guide to ensure it remains a useful resource. From 30ba97dc6d3471ae3692745322348ef84abcf6b4 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Date: Wed, 27 Aug 2025 09:55:04 -0400 Subject: [PATCH 2/8] Apply suggestions from code review Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- Jules.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jules.md b/Jules.md index 40be14fceef..374452b4359 100644 --- a/Jules.md +++ b/Jules.md @@ -20,8 +20,8 @@ To work with this repository, the Android SDK must be installed. Use the `sdkman 1. **Install Android SDK Command-Line Tools**: - If not already installed, download the command-line tools from the [Android Studio page](https://developer.android.com/studio#command-line-tools-only). - Create a directory for the Android SDK, e.g., `android_sdk`. - - Unzip the downloaded package and move the `cmdline-tools` directory into the `android_sdk` directory. - - The final structure should be `android_sdk/cmdline-tools/`. + - Unzip the downloaded package. This will create a `cmdline-tools` directory. Move this directory to `android_sdk/cmdline-tools/latest`. + - The final structure should be `android_sdk/cmdline-tools/latest/`. 2. **Install required SDK packages**: - Use `sdkmanager` to install the necessary platforms, build tools, and other packages. For example: @@ -41,6 +41,9 @@ To work with this repository, the Android SDK must be installed. Use the `sdkman - To run integration tests, a `google-services.json` file is required. - Place this file in the root of the repository. +4. **Install NDK for specific projects**: + - Some projects, like `firebase-crashlytics-ndk`, require a specific version of the Android NDK. You can install it using `sdkmanager`. For example, to install NDK version 21.4.7075529, you would run `sdkmanager "ndk;21.4.7075529"`. Always refer to the project's `README.md` for the exact version required. + --- ## Testing @@ -70,7 +73,7 @@ The public API of the Firebase SDKs is managed using a set of annotations: - `@PublicApi`: Marks APIs that are intended for public consumption by developers. - `@KeepForSdk`: Marks APIs that are intended for use by other Firebase SDKs. These APIs will trigger a linter error if used by developers outside of a Firebase package. -- `@Keep`: Marks APIs that need to be preserved at runtime, usually due to reflection. This annotation should be used sparingly as it prevents the code from being proguarded. +- `@Keep`: Marks APIs that need to be preserved at runtime, usually due to reflection. This annotation should be used sparingly as it prevents Proguard from removing or renaming the code. --- From 9f597a5d56d270d560258df885d44b34f801c62d Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Date: Fri, 29 Aug 2025 09:17:30 -0400 Subject: [PATCH 3/8] [Infra] Enable simple formatter for md (#7308) Using the `prettier` formatter supported in spotless to limit markdown to 100 lines or less. NO_RELEASE_CHANGE --- .github/ISSUE_TEMPLATE/bug.md | 30 +- .github/ISSUE_TEMPLATE/fr.md | 2 +- CONTRIBUTING.md | 31 +- README.md | 164 ++- .../CHANGELOG.md | 71 +- .../firebase-appcheck-debug-testing.gradle | 2 +- appcheck/firebase-appcheck-debug/CHANGELOG.md | 79 +- .../firebase-appcheck-interop/CHANGELOG.md | 2 - .../CHANGELOG.md | 53 +- appcheck/firebase-appcheck/CHANGELOG.md | 166 +-- build.gradle.kts | 5 + ci/README.md | 12 +- ci/workflow_summary/README.md | 290 ++-- contributor-docs/README.md | 5 +- .../best_practices/dependency_injection.md | 85 +- contributor-docs/components/components.md | 143 +- contributor-docs/components/dependencies.md | 98 +- contributor-docs/components/executors.md | 130 +- contributor-docs/how_firebase_works.md | 63 +- contributor-docs/onboarding/env_setup.md | 31 +- contributor-docs/onboarding/new_sdk.md | 80 +- docs/README.md | 47 +- encoders/README.md | 44 +- encoders/firebase-decoders-json/CHANGELOG.md | 2 - encoders/firebase-encoders-json/CHANGELOG.md | 2 - .../firebase-encoders-processor/CHANGELOG.md | 2 - encoders/firebase-encoders-proto/CHANGELOG.md | 4 +- .../firebase-encoders-reflective/CHANGELOG.md | 2 - encoders/firebase-encoders/CHANGELOG.md | 2 - .../protoc-gen-firebase-encoders/CHANGELOG.md | 2 - firebase-abt/CHANGELOG.md | 58 +- firebase-ai/CHANGELOG.md | 98 +- firebase-ai/README.md | 15 +- firebase-ai/src/test/resources/README.md | 4 +- firebase-annotations/CHANGELOG.md | 4 +- firebase-appdistribution-api/CHANGELOG.md | 178 ++- firebase-appdistribution/CHANGELOG.md | 99 +- firebase-appdistribution/test-app/README.md | 60 +- firebase-common/CHANGELOG.md | 46 +- firebase-common/README.md | 7 +- firebase-components/CHANGELOG.md | 13 +- .../CHANGELOG.md | 6 +- firebase-config-interop/CHANGELOG.md | 6 +- firebase-config/CHANGELOG.md | 580 ++++---- firebase-config/test-app/README.md | 16 +- firebase-crashlytics-ndk/CHANGELOG.md | 276 ++-- firebase-crashlytics-ndk/README.md | 6 +- firebase-crashlytics/CHANGELOG.md | 744 +++++------ firebase-crashlytics/README.md | 5 +- firebase-database-collection/CHANGELOG.md | 2 - firebase-database/CHANGELOG.md | 328 ++--- firebase-database/README.md | 11 +- firebase-dataconnect/CHANGELOG.md | 118 +- firebase-dataconnect/README.md | 88 +- firebase-dataconnect/ci/README.md | 10 +- firebase-dataconnect/emulator/README.md | 172 ++- firebase-dataconnect/testutil/README.md | 4 +- firebase-datatransport/CHANGELOG.md | 9 +- firebase-dynamic-links/CHANGELOG.md | 171 ++- firebase-firestore/CHANGELOG.md | 1180 +++++++++-------- firebase-firestore/README.md | 120 +- .../androidTest/assets/conformance/README.md | 4 +- .../firebase/firestore/testutil/providers.md | 32 +- firebase-functions/CHANGELOG.md | 254 ++-- firebase-functions/README.md | 6 +- .../src/androidTest/backend/README.md | 2 +- firebase-inappmessaging-display/CHANGELOG.md | 396 +++--- firebase-inappmessaging-display/README.md | 17 +- firebase-inappmessaging/CHANGELOG.md | 393 +++--- firebase-inappmessaging/README.md | 10 +- firebase-installations-interop/CHANGELOG.md | 3 +- .../API_KEY_RESTRICTIONS.md | 26 +- firebase-installations/CHANGELOG.md | 55 +- firebase-installations/FCM_TOKENS_CHANGE.md | 40 +- .../REQUIRED_FIREBASE_OPTIONS_ANDROID.md | 78 +- firebase-messaging-directboot/CHANGELOG.md | 156 ++- firebase-messaging/CHANGELOG.md | 632 +++++---- firebase-ml-modeldownloader/CHANGELOG.md | 224 ++-- firebase-perf/CHANGELOG.md | 492 ++++--- firebase-perf/README.md | 37 +- firebase-perf/dev-app/README.md | 65 +- firebase-perf/e2e-app/README.md | 46 +- firebase-sessions/CHANGELOG.md | 71 +- firebase-sessions/README.md | 6 +- firebase-sessions/test-app/README.md | 16 +- firebase-storage/CHANGELOG.md | 255 ++-- firebase-storage/README.md | 30 +- firebase-storage/test-app/README.md | 4 +- firebase-vertexai/CHANGELOG.md | 232 ++-- health-metrics/README.md | 18 +- health-metrics/apk-size/README.md | 8 +- health-metrics/benchmark/README.md | 51 +- plugins/README.md | 15 +- .../firebase-storage/CHANGELOG.md | 56 +- .../MakeReleaseNotes/release-notes.md | 48 +- .../resources/MoveUnreleasedChanges/basic.md | 46 +- protolite-well-known-types/CHANGELOG.md | 9 +- protolite-well-known-types/README.md | 34 +- smoke-tests/README.md | 54 +- transport/transport-api/CHANGELOG.md | 16 +- transport/transport-backend-cct/CHANGELOG.md | 16 +- .../transport-runtime-testing/CHANGELOG.md | 2 - transport/transport-runtime/CHANGELOG.md | 18 +- 103 files changed, 5181 insertions(+), 4875 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index afd55e8dee6..7e1210084f4 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -3,37 +3,35 @@ name: ⚠️ Report a Bug about: Think you found a bug in the SDK? Report it here. --- - ### [READ] Step 1: Are you in the right place? -Issues filed here should be about bugs in __the code in this repository__. -If you have a general question, need help debugging, or fall into some -other category use one of these other channels: +Issues filed here should be about bugs in **the code in this repository**. If you have a general +question, need help debugging, or fall into some other category use one of these other channels: - * For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/) - with the firebase tag. - * For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk) - google group. - * For help troubleshooting your application that does not fall under one - of the above categories, reach out to the personalized - [Firebase support channel](https://firebase.google.com/support/). +- For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/) + with the firebase tag. +- For general Firebase discussion, use the + [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk) google group. +- For help troubleshooting your application that does not fall under one of the above categories, + reach out to the personalized [Firebase support channel](https://firebase.google.com/support/). ### [REQUIRED] Step 2: Describe your environment - * Android Studio version: _____ - * Firebase Component: _____ (Database, Firestore, Storage, Functions, etc) - * Component version: _____ +- Android Studio version: **\_** +- Firebase Component: **\_** (Database, Firestore, Storage, Functions, etc) +- Component version: **\_** ### [REQUIRED] Step 3: Describe the problem #### Steps to reproduce: -What happened? How can we make the problem occur? -This could be a description, log/console output, etc. +What happened? How can we make the problem occur? This could be a description, log/console output, +etc. #### Relevant Code: diff --git a/.github/ISSUE_TEMPLATE/fr.md b/.github/ISSUE_TEMPLATE/fr.md index cdd3d6922ba..1989c975964 100644 --- a/.github/ISSUE_TEMPLATE/fr.md +++ b/.github/ISSUE_TEMPLATE/fr.md @@ -3,7 +3,7 @@ name: 💡 Feature Request about: Have a feature you'd like to see in the Android SDK? Request it here. --- - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0360670700..8dbfd45addb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,26 +1,24 @@ # How to Contribute -We'd love to accept your patches and contributions to this project. There are -just a few small guidelines you need to follow. +We'd love to accept your patches and contributions to this project. There are just a few small +guidelines you need to follow. ## Contributor License Agreement -Contributions to this project must be accompanied by a Contributor License -Agreement. You (or your employer) retain the copyright to your contribution; -this simply gives us permission to use and redistribute your contributions as -part of the project. Head over to to see -your current agreements on file or to sign a new one. +Contributions to this project must be accompanied by a Contributor License Agreement. You (or your +employer) retain the copyright to your contribution; this simply gives us permission to use and +redistribute your contributions as part of the project. Head over to + to see your current agreements on file or to sign a new one. -You generally only need to submit a CLA once, so if you've already submitted one -(even if it was for a different project), you probably don't need to do it -again. +You generally only need to submit a CLA once, so if you've already submitted one (even if it was for +a different project), you probably don't need to do it again. ## Code reviews -All submissions, including submissions by project members, require review. We -use GitHub pull requests for this purpose. Consult -[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more -information on using pull requests. +All submissions, including submissions by project members, require review. We use GitHub pull +requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using +pull requests. ## Community Guidelines @@ -29,5 +27,6 @@ This project follows ## Contributor Documentation -To know more about how to setup your environment, how Firebase internals work, and -best practices, take a look at our detailed [contributor documentation](https://firebase.github.io/firebase-android-sdk/). \ No newline at end of file +To know more about how to setup your environment, how Firebase internals work, and best practices, +take a look at our detailed +[contributor documentation](https://firebase.github.io/firebase-android-sdk/). diff --git a/README.md b/README.md index 236028bb6a5..948d6254ce3 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ # Firebase Android Open Source Development -This repository contains the source code for all Android Firebase SDKs except -Analytics and Auth. +This repository contains the source code for all Android Firebase SDKs except Analytics and Auth. -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. +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. ## Table of contents @@ -15,10 +13,8 @@ https://firebase.google.com. 1. [Integration Testing](#integration-testing) 1. [Proguarding](#proguarding) 1. [APIs used via reflection](#APIs-used-via-reflection) - 1. [APIs intended for developer - consumption](#APIs-intended-for-developer-consumption) - 1. [APIs intended for other Firebase - SDKs](#APIs-intended-for-other-firebase-sdks) + 1. [APIs intended for developer consumption](#APIs-intended-for-developer-consumption) + 1. [APIs intended for other Firebase SDKs](#APIs-intended-for-other-firebase-sdks) 1. [Publishing](#publishing) 1. [Dependencies](#dependencies) 1. [Commands](#commands) @@ -27,23 +23,22 @@ https://firebase.google.com. ## Getting Started -* Install the latest Android Studio (should be Meerkat | 2024.3.1 or later) -* Clone the repo (`git clone --recurse-submodules git@github.com:firebase/firebase-android-sdk.git`) - * When cloning the repo, it is important to get the submodules as well. If - you have already cloned the repo without the submodules, you can update the - submodules by running `git submodule update --init --recursive`. -* Import the firebase-android-sdk gradle project into Android Studio using the - **Import project(Gradle, Eclipse ADT, etc.)** option. -* `firebase-crashlytics-ndk` must be built with NDK 21. See - [firebase-crashlytics-ndk](firebase-crashlytics-ndk/README.md) for more - details. +- Install the latest Android Studio (should be Meerkat | 2024.3.1 or later) +- Clone the repo (`git clone --recurse-submodules git@github.com:firebase/firebase-android-sdk.git`) + - When cloning the repo, it is important to get the submodules as well. If you have already cloned + the repo without the submodules, you can update the submodules by running + `git submodule update --init --recursive`. +- Import the firebase-android-sdk gradle project into Android Studio using the **Import + project(Gradle, Eclipse ADT, etc.)** option. +- `firebase-crashlytics-ndk` must be built with NDK 21. See + [firebase-crashlytics-ndk](firebase-crashlytics-ndk/README.md) for more details. ## Testing Firebase Android libraries exercise all three types of tests recommended by the [Android Testing Pyramid](https://developer.android.com/training/testing/fundamentals#testing-pyramid). -Depending on the requirements of the specific project, some or all of these -tests may be used to support changes. +Depending on the requirements of the specific project, some or all of these tests may be used to +support changes. > :warning: **Running tests with errorprone** > @@ -53,48 +48,46 @@ tests may be used to support changes. ### Unit Testing -These are tests that run on your machine's local Java Virtual Machine (JVM). At -runtime, these tests are executed against a modified version of android.jar -where all final modifiers have been stripped off. This lets us sandbox behaviors -at desired places and use popular mocking libraries. +These are tests that run on your machine's local Java Virtual Machine (JVM). At runtime, these tests +are executed against a modified version of android.jar where all final modifiers have been stripped +off. This lets us sandbox behaviors at desired places and use popular mocking libraries. Unit tests can be executed on the command line by running + ```bash ./gradlew ::check ``` ### Integration Testing -These are tests that run on a hardware device or emulator. These tests have -access to Instrumentation APIs, give you access to information such as the -[Android Context](https://developer.android.com/reference/android/content/Context). -In Firebase, instrumentation tests are used at different capacities by different -projects. Some tests may exercise device capabilities, while stubbing any calls -to the backend, while some others may call out to nightly backend builds to -ensure distributed API compatibility. +These are tests that run on a hardware device or emulator. These tests have access to +Instrumentation APIs, give you access to information such as the +[Android Context](https://developer.android.com/reference/android/content/Context). In Firebase, +instrumentation tests are used at different capacities by different projects. Some tests may +exercise device capabilities, while stubbing any calls to the backend, while some others may call +out to nightly backend builds to ensure distributed API compatibility. -Along with Espresso, they are also used to test projects that have UI -components. +Along with Espresso, they are also used to test projects that have UI components. #### Project Setup -Before you can run integration tests, you need to add a `google-services.json` -file to the root of your checkout. You can use the `google-services.json` from -any project that includes an Android App, though you'll likely want one that's -separate from any production data you have because our tests write random data. +Before you can run integration tests, you need to add a `google-services.json` file to the root of +your checkout. You can use the `google-services.json` from any project that includes an Android App, +though you'll likely want one that's separate from any production data you have because our tests +write random data. If you don't have a suitable testing project already: - * Open the [Firebase console](https://console.firebase.google.com/) - * If you don't yet have a project you want to use for testing, create one. - * Add an Android app to the project - * Give the app any package name you like. - * Download the resulting `google-services.json` file and put it in the root of - your checkout. +- Open the [Firebase console](https://console.firebase.google.com/) +- If you don't yet have a project you want to use for testing, create one. +- Add an Android app to the project +- Give the app any package name you like. +- Download the resulting `google-services.json` file and put it in the root of your checkout. #### Running Integration Tests on Local Emulator Integration tests can be executed on the command line by running + ```bash ./gradlew ::connectedCheck ``` @@ -103,11 +96,12 @@ Integration tests can be executed on the command line by running > You need additional setup for this to work: > -> * `gcloud` needs to be [installed](https://cloud.google.com/sdk/install) on local machine -> * `gcloud` needs to be configured with a project that has billing enabled -> * `gcloud` needs to be authenticated with credentials that have 'Firebase Test Lab Admin' role +> - `gcloud` needs to be [installed](https://cloud.google.com/sdk/install) on local machine +> - `gcloud` needs to be configured with a project that has billing enabled +> - `gcloud` needs to be authenticated with credentials that have 'Firebase Test Lab Admin' role Integration tests can be executed on the command line by running + ```bash ./gradlew ::deviceCheck ``` @@ -134,70 +128,62 @@ Firebase SDKs use some special annotations for tooling purposes. ### @Keep APIs that need to be preserved up until the app's runtime can be annotated with -[@Keep](https://developer.android.com/reference/android/support/annotation/Keep). -The -[@Keep](https://developer.android.com/reference/android/support/annotation/Keep) -annotation is *blessed* to be honored by android's [default proguard -configuration](https://developer.android.com/studio/write/annotations#keep). A common use for -this annotation is because of reflection. These APIs should be generally **discouraged**, because -they can't be proguarded. +[@Keep](https://developer.android.com/reference/android/support/annotation/Keep). The +[@Keep](https://developer.android.com/reference/android/support/annotation/Keep) annotation is +_blessed_ to be honored by android's +[default proguard configuration](https://developer.android.com/studio/write/annotations#keep). A +common use for this annotation is because of reflection. These APIs should be generally +**discouraged**, because they can't be proguarded. ### @KeepForSdk -APIs that are intended to be used by Firebase SDKs should be annotated with -`@KeepForSdk`. The key benefit here is that the annotation is *blessed* to throw -linter errors on Android Studio if used by the developer from a non firebase -package, thereby providing a valuable guard rail. - +APIs that are intended to be used by Firebase SDKs should be annotated with `@KeepForSdk`. The key +benefit here is that the annotation is _blessed_ to throw linter errors on Android Studio if used by +the developer from a non firebase package, thereby providing a valuable guard rail. ### @PublicApi We annotate APIs that meant to be used by developers with -[@PublicAPI](firebase-common/src/main/java/com/google/firebase/annotations/PublicApi.java). This +[@PublicAPI](firebase-common/src/main/java/com/google/firebase/annotations/PublicApi.java). This annotation will be used by tooling to help inform the version bump (major, minor, patch) that is required for the next release. ## Proguarding -Firebase SDKs do not proguard themselves, but support proguarding. Firebase SDKs themselves are +Firebase SDKs do not proguard themselves, but support proguarding. Firebase SDKs themselves are proguard friendly, but the dependencies of Firebase SDKs may not be. ### Proguard config -In addition to preguard.txt, projects declare an additional set of proguard -rules in a proguard.txt that are honored by the developer's app while building -the app's proguarded apk. This file typically contains the keep rules that need -to be honored during the app' s proguarding phase. +In addition to preguard.txt, projects declare an additional set of proguard rules in a proguard.txt +that are honored by the developer's app while building the app's proguarded apk. This file typically +contains the keep rules that need to be honored during the app' s proguarding phase. -As a best practice, these explicit rules should be scoped to only libraries -whose source code is outside the firebase-android-sdk codebase making annotation -based approaches insufficient.The combination of keep rules resulting from the -annotations, the preguard.txt and the proguard.txt collectively determine the -APIs that are preserved at **runtime**. +As a best practice, these explicit rules should be scoped to only libraries whose source code is +outside the firebase-android-sdk codebase making annotation based approaches insufficient.The +combination of keep rules resulting from the annotations, the preguard.txt and the proguard.txt +collectively determine the APIs that are preserved at **runtime**. ## Publishing -Firebase is published as a collection of libraries each of which either -represents a top level product, or contains shared functionality used by one or -more projects. The projects are published as managed maven artifacts available -at [Google's Maven Repository](https://maven.google.com). This section helps -reason about how developers may make changes to firebase projects and have their -apps depend on the modified versions of Firebase. +Firebase is published as a collection of libraries each of which either represents a top level +product, or contains shared functionality used by one or more projects. The projects are published +as managed maven artifacts available at [Google's Maven Repository](https://maven.google.com). This +section helps reason about how developers may make changes to firebase projects and have their apps +depend on the modified versions of Firebase. ### Dependencies Any dependencies, within the projects, or outside of Firebase are encoded as [maven dependencies](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) -into the `pom` file that accompanies the published artifact. This allows the -developer's build system (typically Gradle) to build a dependency graph and -select the dependencies using its own [resolution -strategy](https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html) +into the `pom` file that accompanies the published artifact. This allows the developer's build +system (typically Gradle) to build a dependency graph and select the dependencies using its own +[resolution strategy](https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html) ### Commands -For more advanced use cases where developers wish to make changes to a project, -but have transitive dependencies point to publicly released versions, individual -projects may be published as follows. +For more advanced use cases where developers wish to make changes to a project, but have transitive +dependencies point to publicly released versions, individual projects may be published as follows. ```bash # e.g. to publish Firestore and Functions @@ -205,21 +191,21 @@ projects may be published as follows. publishReleasingLibrariesToMavenLocal ``` -Developers may take a dependency on these locally published versions by adding -the `mavenLocal()` repository to your [repositories -block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in -your app module's build.gradle. +Developers may take a dependency on these locally published versions by adding the `mavenLocal()` +repository to your +[repositories block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in your +app module's build.gradle. ### Code Formatting Java and Kotlin are both formatted using `spotless`. To run formatting on a project, run + ```bash ./gradlew ::spotlessApply ``` ### Contributing -We love contributions! Please read our -[contribution guidelines](/CONTRIBUTING.md) to get started. +We love contributions! Please read our [contribution guidelines](/CONTRIBUTING.md) to get started. diff --git a/appcheck/firebase-appcheck-debug-testing/CHANGELOG.md b/appcheck/firebase-appcheck-debug-testing/CHANGELOG.md index b59c142ca32..87f31442eb6 100644 --- a/appcheck/firebase-appcheck-debug-testing/CHANGELOG.md +++ b/appcheck/firebase-appcheck-debug-testing/CHANGELOG.md @@ -1,67 +1,78 @@ # Unreleased - # 19.0.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 18.0.0 -* [changed] Bump internal dependencies + +- [changed] Bump internal dependencies # 17.1.2 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.1.1 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.1.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.0.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 16.1.2 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 16.1.1 -* [changed] Integrated the [app_check] Debug Testing SDK with Firebase - components. - (GitHub [#4436](//github.com/firebase/firebase-android-sdk/issues/4436){: .external}) + +- [changed] Integrated the [app_check] Debug Testing SDK with Firebase components. (GitHub + [#4436](//github.com/firebase/firebase-android-sdk/issues/4436){: .external}) # 16.1.0 -* [unchanged] Updated to accommodate the release of the updated - [app_check] Kotlin extensions library. + +- [unchanged] Updated to accommodate the release of the updated [app_check] Kotlin extensions + library. # 16.0.1 -* [changed] Updated dependency of `play-services-basement` to its latest - version (v18.1.0). + +- [changed] Updated dependency of `play-services-basement` to its latest version (v18.1.0). # 16.0.0 -* [changed] [app_check] has exited beta and is now generally available for - use. + +- [changed] [app_check] has exited beta and is now generally available for use. # 16.0.0-beta06 -* [fixed] Fixed a bug in the [app_check] token refresh flow when using a - custom provider. + +- [fixed] Fixed a bug in the [app_check] token refresh flow when using a custom provider. # 16.0.0-beta05 -* [changed] Internal improvements. + +- [changed] Internal improvements. # 16.0.0-beta04 -* [changed] Improved error handling logic by minimizing the amount of requests - that are unlikely to succeed. -* [fixed] Fixed heartbeat reporting. + +- [changed] Improved error handling logic by minimizing the amount of requests that are unlikely to + succeed. +- [fixed] Fixed heartbeat reporting. # 16.0.0-beta03 -* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to - [app_check] network calls. + +- [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to [app_check] network + calls. # 16.0.0-beta02 -* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)), + +- [feature] Added + [`getAppCheckToken()`](), [`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener), - and associated setters and removers for developers to request and observe - changes to the [app_check] token. + and associated setters and removers for developers to request and observe changes to the + [app_check] token. # 16.0.0-beta01 -* [feature] Initial beta release of the [app_check] Debug Testing SDK with - abuse reduction features. +- [feature] Initial beta release of the [app_check] Debug Testing SDK with abuse reduction features. diff --git a/appcheck/firebase-appcheck-debug-testing/firebase-appcheck-debug-testing.gradle b/appcheck/firebase-appcheck-debug-testing/firebase-appcheck-debug-testing.gradle index 13edcbad809..d2134379e3f 100644 --- a/appcheck/firebase-appcheck-debug-testing/firebase-appcheck-debug-testing.gradle +++ b/appcheck/firebase-appcheck-debug-testing/firebase-appcheck-debug-testing.gradle @@ -14,7 +14,7 @@ plugins { id 'firebase-library' - id 'copy-google-services' +// id 'copy-google-services' } firebaseLibrary { diff --git a/appcheck/firebase-appcheck-debug/CHANGELOG.md b/appcheck/firebase-appcheck-debug/CHANGELOG.md index cb3b7b23c55..ac26f2cdcae 100644 --- a/appcheck/firebase-appcheck-debug/CHANGELOG.md +++ b/appcheck/firebase-appcheck-debug/CHANGELOG.md @@ -1,72 +1,83 @@ # Unreleased - # 19.0.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 18.0.0 -* [changed] Bump internal dependencies + +- [changed] Bump internal dependencies # 17.1.2 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.1.1 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.1.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.0.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 16.1.2 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 16.1.1 -* [changed] Migrated [app_check] SDKs to use standard Firebase executors. - (GitHub [#4431](//github.com/firebase/firebase-android-sdk/issues/4431){: .external} - and + +- [changed] Migrated [app_check] SDKs to use standard Firebase executors. (GitHub + [#4431](//github.com/firebase/firebase-android-sdk/issues/4431){: .external} and [#4449](//github.com/firebase/firebase-android-sdk/issues/4449){: .external}) -* [changed] Integrated the [app_check] Debug SDK with Firebase components. - (GitHub [#4436](//github.com/firebase/firebase-android-sdk/issues/4436){: .external}) -* [changed] Moved Task continuations off the main thread. - (GitHub [#4453](//github.com/firebase/firebase-android-sdk/issues/4453){: .external}) +- [changed] Integrated the [app_check] Debug SDK with Firebase components. (GitHub + [#4436](//github.com/firebase/firebase-android-sdk/issues/4436){: .external}) +- [changed] Moved Task continuations off the main thread. (GitHub + [#4453](//github.com/firebase/firebase-android-sdk/issues/4453){: .external}) # 16.1.0 -* [unchanged] Updated to accommodate the release of the updated - [app_check] Kotlin extensions library. + +- [unchanged] Updated to accommodate the release of the updated [app_check] Kotlin extensions + library. # 16.0.1 -* [changed] Updated dependency of `play-services-basement` to its latest - version (v18.1.0). + +- [changed] Updated dependency of `play-services-basement` to its latest version (v18.1.0). # 16.0.0 -* [changed] [app_check] has exited beta and is now generally available for - use. + +- [changed] [app_check] has exited beta and is now generally available for use. # 16.0.0-beta06 -* [fixed] Fixed a bug in the [app_check] token refresh flow when using a - custom provider. + +- [fixed] Fixed a bug in the [app_check] token refresh flow when using a custom provider. # 16.0.0-beta05 -* [changed] Internal improvements. + +- [changed] Internal improvements. # 16.0.0-beta04 -* [changed] Improved error handling logic by minimizing the amount of requests - that are unlikely to succeed. -* [fixed] Fixed heartbeat reporting. + +- [changed] Improved error handling logic by minimizing the amount of requests that are unlikely to + succeed. +- [fixed] Fixed heartbeat reporting. # 16.0.0-beta03 -* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to - [app_check] network calls. + +- [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to [app_check] network + calls. # 16.0.0-beta02 -* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)), + +- [feature] Added + [`getAppCheckToken()`](), [`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener), - and associated setters and removers for developers to request and observe - changes to the [app_check] token. + and associated setters and removers for developers to request and observe changes to the + [app_check] token. # 16.0.0-beta01 -* [feature] Initial beta release of the [app_check] Debug SDK with abuse - reduction features. +- [feature] Initial beta release of the [app_check] Debug SDK with abuse reduction features. diff --git a/appcheck/firebase-appcheck-interop/CHANGELOG.md b/appcheck/firebase-appcheck-interop/CHANGELOG.md index f514bbb890e..79e701b844d 100644 --- a/appcheck/firebase-appcheck-interop/CHANGELOG.md +++ b/appcheck/firebase-appcheck-interop/CHANGELOG.md @@ -1,3 +1 @@ # Unreleased - - diff --git a/appcheck/firebase-appcheck-playintegrity/CHANGELOG.md b/appcheck/firebase-appcheck-playintegrity/CHANGELOG.md index 7a8f91b7e72..26af9a4c2dc 100644 --- a/appcheck/firebase-appcheck-playintegrity/CHANGELOG.md +++ b/appcheck/firebase-appcheck-playintegrity/CHANGELOG.md @@ -1,49 +1,54 @@ # Unreleased - # 19.0.0 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. # 18.0.0 -* [changed] Bump internal dependencies + +- [changed] Bump internal dependencies # 17.1.2 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.1.1 -* [fixed] Fixed client-side throttling in Play Integrity flows. -* [changed] Bumped Play Integrity API Library dependency version. + +- [fixed] Fixed client-side throttling in Play Integrity flows. +- [changed] Bumped Play Integrity API Library dependency version. # 17.1.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 17.0.0 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 16.1.2 -* [unchanged] Updated to keep [app_check] SDK versions aligned. + +- [unchanged] Updated to keep [app_check] SDK versions aligned. # 16.1.1 -* [changed] Migrated [app_check] SDKs to use standard Firebase executors. - (GitHub [#4431](//github.com/firebase/firebase-android-sdk/issues/4431){: .external} - and + +- [changed] Migrated [app_check] SDKs to use standard Firebase executors. (GitHub + [#4431](//github.com/firebase/firebase-android-sdk/issues/4431){: .external} and [#4449](//github.com/firebase/firebase-android-sdk/issues/4449){: .external}) -* [changed] Integrated the [app_check] Play integrity SDK with Firebase - components. - (GitHub [#4436](//github.com/firebase/firebase-android-sdk/issues/4436){: .external}) -* [changed] Moved Task continuations off the main thread. - (GitHub [#4453](//github.com/firebase/firebase-android-sdk/issues/4453){: .external}) +- [changed] Integrated the [app_check] Play integrity SDK with Firebase components. (GitHub + [#4436](//github.com/firebase/firebase-android-sdk/issues/4436){: .external}) +- [changed] Moved Task continuations off the main thread. (GitHub + [#4453](//github.com/firebase/firebase-android-sdk/issues/4453){: .external}) # 16.1.0 -* [unchanged] Updated to accommodate the release of the updated - [app_check] Kotlin extensions library. + +- [unchanged] Updated to accommodate the release of the updated [app_check] Kotlin extensions + library. # 16.0.1 -* [changed] Updated dependency of `play-services-basement` to its latest - version (v18.1.0). + +- [changed] Updated dependency of `play-services-basement` to its latest version (v18.1.0). # 16.0.0 -* [feature] Added support for - [Play Integrity](https://developer.android.com/google/play/integrity) as an - attestation provider. +- [feature] Added support for [Play Integrity](https://developer.android.com/google/play/integrity) + as an attestation provider. diff --git a/appcheck/firebase-appcheck/CHANGELOG.md b/appcheck/firebase-appcheck/CHANGELOG.md index 5a5c6231b96..4cd5b76aceb 100644 --- a/appcheck/firebase-appcheck/CHANGELOG.md +++ b/appcheck/firebase-appcheck/CHANGELOG.md @@ -1,148 +1,150 @@ # Unreleased - # 19.0.0 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. -* [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions - (KTX) module and removed it from the Firebase Android BoM. Instead, use the KTX APIs - from the main module. For details, see the + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. +- [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions (KTX) module and + removed it from the Firebase Android BoM. Instead, use the KTX APIs from the main module. For + details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration). # 18.0.0 -* [changed] Bump internal dependencies -* [changed] Internal support for `SafetyNet` has been dropped, as the [SafetyNet Attestation API -has been deprecated.](https://developer.android.com/privacy-and-security/safetynet/deprecation-timeline#safetynet_attestation_deprecation_timeline) +- [changed] Bump internal dependencies +- [changed] Internal support for `SafetyNet` has been dropped, as the + [SafetyNet Attestation API has been deprecated.](https://developer.android.com/privacy-and-security/safetynet/deprecation-timeline#safetynet_attestation_deprecation_timeline) ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has no additional updates. # 17.1.2 -* [changed] Bump internal dependencies. +- [changed] Bump internal dependencies. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has no additional updates. # 17.1.1 -* [fixed] Fixed a bug causing internal tests to depend directly on `firebase-common`. -* [fixed] Fixed client-side throttling in Play Integrity flows. +- [fixed] Fixed a bug causing internal tests to depend directly on `firebase-common`. +- [fixed] Fixed client-side throttling in Play Integrity flows. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has no additional updates. # 17.1.0 -* [changed] Added Kotlin extensions (KTX) APIs from `com.google.firebase:firebase-appcheck-ktx` - to `com.google.firebase:firebase-appcheck` under the `com.google.firebase.appcheck` package. - For details, see the + +- [changed] Added Kotlin extensions (KTX) APIs from `com.google.firebase:firebase-appcheck-ktx` to + `com.google.firebase:firebase-appcheck` under the `com.google.firebase.appcheck` package. For + details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) -* [deprecated] All the APIs from `com.google.firebase:firebase-appcheck-ktx` have been added to - `com.google.firebase:firebase-appcheck` under the `com.google.firebase.appcheck` package, - and all the Kotlin extensions (KTX) APIs in `com.google.firebase:firebase-appcheck-ktx` are - now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the +- [deprecated] All the APIs from `com.google.firebase:firebase-appcheck-ktx` have been added to + `com.google.firebase:firebase-appcheck` under the `com.google.firebase.appcheck` package, and all + the Kotlin extensions (KTX) APIs in `com.google.firebase:firebase-appcheck-ktx` are now + deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has no additional updates. # 17.0.1 -* [changed] Internal updates to allow Firebase SDKs to obtain limited-use tokens. + +- [changed] Internal updates to allow Firebase SDKs to obtain limited-use tokens. # 17.0.0 -* [feature] Added [`getLimitedUseAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getLimitedUseAppCheckToken()) - for obtaining limited-use tokens for protecting non-Firebase backends. +- [feature] Added + [`getLimitedUseAppCheckToken()`]() + for obtaining limited-use tokens for protecting non-Firebase backends. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has no additional updates. # 16.1.2 -* [unchanged] Updated to keep [app_check] SDK versions aligned. +- [unchanged] Updated to keep [app_check] SDK versions aligned. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has no additional updates. # 16.1.1 -* [changed] Migrated [app_check] SDKs to use standard Firebase executors. - (GitHub [#4431](//github.com/firebase/firebase-android-sdk/issues/4431){: .external} - and - [#4449](//github.com/firebase/firebase-android-sdk/issues/4449){: .external}) -* [changed] Moved Task continuations off the main thread. - (GitHub [#4453](//github.com/firebase/firebase-android-sdk/issues/4453){: .external}) +- [changed] Migrated [app_check] SDKs to use standard Firebase executors. (GitHub + [#4431](//github.com/firebase/firebase-android-sdk/issues/4431){: .external} and + [#4449](//github.com/firebase/firebase-android-sdk/issues/4449){: .external}) +- [changed] Moved Task continuations off the main thread. (GitHub + [#4453](//github.com/firebase/firebase-android-sdk/issues/4453){: .external}) ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has no additional updates. # 16.1.0 -* [unchanged] Updated to accommodate the release of the updated - [app_check] Kotlin extensions library. +- [unchanged] Updated to accommodate the release of the updated [app_check] Kotlin extensions + library. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appcheck` library. The Kotlin extensions library has the following -additional updates: - -* [feature] Firebase now supports Kotlin coroutines. - With this release, we added - [`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: .external} - to `firebase-appcheck-ktx` as a transitive dependency, which exposes the + +The Kotlin extensions library transitively includes the updated `firebase-appcheck` library. The +Kotlin extensions library has the following additional updates: + +- [feature] Firebase now supports Kotlin coroutines. With this release, we added + [`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: + .external} to `firebase-appcheck-ktx` as a transitive dependency, which exposes the `Task.await()` suspend function to convert a - [`Task`](https://developers.google.com/android/guides/tasks) into a Kotlin - coroutine. + [`Task`](https://developers.google.com/android/guides/tasks) into a Kotlin coroutine. # 16.0.1 -* [changed] Updated dependency of `play-services-basement` to its latest - version (v18.1.0). + +- [changed] Updated dependency of `play-services-basement` to its latest version (v18.1.0). # 16.0.0 -* [changed] [app_check] has exited beta and is now generally available for - use. -* [feature] Added support for - [Play Integrity](https://developer.android.com/google/play/integrity) as an - attestation provider. + +- [changed] [app_check] has exited beta and is now generally available for use. +- [feature] Added support for [Play Integrity](https://developer.android.com/google/play/integrity) + as an attestation provider. # 16.0.0-beta06 -* [fixed] Fixed a bug in the [app_check] token refresh flow when using a - custom provider. + +- [fixed] Fixed a bug in the [app_check] token refresh flow when using a custom provider. # 16.0.0-beta05 -* [changed] Internal improvements. + +- [changed] Internal improvements. # 16.0.0-beta04 -* [changed] Improved error handling logic by minimizing the amount of requests - that are unlikely to succeed. -* [fixed] Fixed heartbeat reporting. + +- [changed] Improved error handling logic by minimizing the amount of requests that are unlikely to + succeed. +- [fixed] Fixed heartbeat reporting. # 16.0.0-beta03 -* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to - [app_check] network calls. + +- [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to [app_check] network + calls. # 16.0.0-beta02 -* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)), + +- [feature] Added + [`getAppCheckToken()`](), [`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener), - and associated setters and removers for developers to request and observe - changes to the [app_check] token. + and associated setters and removers for developers to request and observe changes to the + [app_check] token. # 16.0.0-beta01 -* [feature] Initial beta release of the [app_check] SDK with abuse reduction - features. +- [feature] Initial beta release of the [app_check] SDK with abuse reduction features. diff --git a/build.gradle.kts b/build.gradle.kts index ec33368b81e..b984eba05a3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -60,6 +60,11 @@ fun Project.applySpotless() { target("*.gradle.kts") // default target for kotlinGradle ktfmt("0.41").googleStyle() } + format("styling") { + target("src/**/*.md", "*.md", "docs/**/*.md") + targetExclude("**/third_party/**", "src/test/resources/**") + prettier().config(mapOf("printWidth" to 100, "proseWrap" to "always")) + } } } diff --git a/ci/README.md b/ci/README.md index a4b4eb4799b..1948ff3b7e3 100644 --- a/ci/README.md +++ b/ci/README.md @@ -14,6 +14,7 @@ This directory contains tooling used to run Continuous Integration tasks. source ~/.venvs/fireci/bin/activate ``` - At the root of the firebase sdk repo, run + ``` pip3 install -e ./ci/fireci/ ``` @@ -25,8 +26,8 @@ This directory contains tooling used to run Continuous Integration tasks. ## Uninstall -If you run into any issues and need to re-install, or uninstall the package, you can do so -by uninstalling the `fireci` package. +If you run into any issues and need to re-install, or uninstall the package, you can do so by +uninstalling the `fireci` package. ```shell pip3 uninstall fireci -y @@ -34,8 +35,8 @@ pip3 uninstall fireci -y ## Debug -By default, if you're not running `fireci` within the context of CI, the minimum log level is set -to `INFO`. +By default, if you're not running `fireci` within the context of CI, the minimum log level is set to +`INFO`. To manually set the level to `DEBUG`, you can use the `--debug` flag. @@ -43,5 +44,4 @@ To manually set the level to `DEBUG`, you can use the `--debug` flag. fireci --debug clean ``` -> ![NOTE] -> The `--debug` flag must come _before_ the command. +> ![NOTE] The `--debug` flag must come _before_ the command. diff --git a/ci/workflow_summary/README.md b/ci/workflow_summary/README.md index c60558db9d2..d6318224ea2 100644 --- a/ci/workflow_summary/README.md +++ b/ci/workflow_summary/README.md @@ -1,176 +1,190 @@ # `workflow_information.py` Script ## Prerequisites -- [Python](https://www.python.org/) and required packages. - ``` - pip install requests argparse - ``` + +- [Python](https://www.python.org/) and required packages. + ``` + pip install requests argparse + ``` ## Usage -- Collect last `90` days' `Postsubmit` `ci_workflow.yml` workflow runs: - ``` - python workflow_information.py --token ${your_github_toke} --branch master --event push --d 90 - ``` -- Collect last `30` days' `Presubmit` `ci_workflow.yml` workflow runs: - ``` - python workflow_information.py --token ${your_github_toke} --event pull_request --d 30 - ``` +- Collect last `90` days' `Postsubmit` `ci_workflow.yml` workflow runs: + + ``` + python workflow_information.py --token ${your_github_toke} --branch master --event push --d 90 + ``` + +- Collect last `30` days' `Presubmit` `ci_workflow.yml` workflow runs: -- Please refer to `Inputs` section for more use cases, and `Outputs` section for the workflow summary report format. + ``` + python workflow_information.py --token ${your_github_toke} --event pull_request --d 30 + ``` + +- Please refer to `Inputs` section for more use cases, and `Outputs` section for the workflow + summary report format. ## Inputs -- `-o, --repo_owner`: **[Required]** GitHub repo owner, default value is `firebase`. -- `-n, --repo_name`: **[Required]** GitHub repo name, default value is `firebase-android-sdk`. +- `-o, --repo_owner`: **[Required]** GitHub repo owner, default value is `firebase`. -- `-t, --token`: **[Required]** GitHub access token. See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). +- `-n, --repo_name`: **[Required]** GitHub repo name, default value is `firebase-android-sdk`. -- `-w, --workflow_name`: **[Required]** Workflow filename, default value is `ci_tests.yml`. +- `-t, --token`: **[Required]** GitHub access token. See + [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). -- `-d, --days`: Filter workflows that running in past -d days, default value is `90`. See [retention period for GitHub Actions artifacts and logs](https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization). +- `-w, --workflow_name`: **[Required]** Workflow filename, default value is `ci_tests.yml`. -- `-b, --branch`: Filter branch name that workflows run against. +- `-d, --days`: Filter workflows that running in past -d days, default value is `90`. See + [retention period for GitHub Actions artifacts and logs](https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization). -- `-a, --actor`: Filter the actor who triggers the workflow runs. +- `-b, --branch`: Filter branch name that workflows run against. -- `-e, --event`: Filter workflows trigger event, could be one of the following values `['push', 'pull_request', 'issue']`. +- `-a, --actor`: Filter the actor who triggers the workflow runs. -- `-j, --jobs`: Filter workflows jobs, default is `all` (including rerun jobs), could be one of the following values `['latest', 'all']`. +- `-e, --event`: Filter workflows trigger event, could be one of the following values + `['push', 'pull_request', 'issue']`. -- `-f, --folder`: Workflow and job information will be store here, default value is the current datatime. +- `-j, --jobs`: Filter workflows jobs, default is `all` (including rerun jobs), could be one of the + following values `['latest', 'all']`. +- `-f, --folder`: Workflow and job information will be store here, default value is the current + datatime. ## Outputs -- `workflow_summary_report.txt`: a general report contains workflow pass/failure count, running time, etc. - - ``` - 2023-03-03 01:37:07.114500 - Namespace(actor=None, branch=None, days=30, event='pull_request', folder='presubmit_30', jobs='all', repo_name='firebase-android-sdk', repo_owner='firebase', token=${your_github_token}, workflow_name='ci_tests.yml') - - Workflow 'ci_tests.yml' Report: - Workflow Failure Rate:64.77% - Workflow Total Count: 193 (success: 68, failure: 125) - - Workflow Runtime Report: - 161 workflow runs finished without rerun, the average running time: 0:27:24.745342 - Including: - 56 passed workflow runs, with average running time: 0:17:29.214286 - 105 failed workflow runs, with average running time: 0:32:42.361905 - - 32 runs finished with rerun, the average running time: 1 day, 3:57:53.937500 - The running time for each workflow reruns are: - ['1 day, 2:24:32', '3:35:54', '3:19:14', '4 days, 6:10:50', '15:33:39', '1:57:21', '1:13:12', '1:55:18', '12 days, 21:51:29', '0:48:48', '0:45:28', '1:40:21', '2 days, 1:46:35', '19:47:16', '0:45:49', '2:22:36', '0:25:22', '0:55:30', '1:40:32', '1:10:05', '20:08:38', '0:31:03', '5 days, 9:19:25', '5:10:44', '1:20:57', '0:28:47', '1:52:44', '20:19:17', '0:35:15', '21:31:07', '3 days, 1:06:44', '3 days, 2:18:14'] - - Job Failure Report: - Unit Tests (:firebase-storage): - Failure Rate:54.61% - Total Count: 152 (success: 69, failure: 83) - Unit Tests (:firebase-messaging): - Failure Rate:35.37% - Total Count: 147 (success: 95, failure: 52) - ``` - - -- Intermediate file `workflow_summary.json`: contains all the workflow runs and job information attached to each workflow. - - ``` - { - 'workflow_name':'ci_tests.yml', - 'total_count':81, - 'success_count':32, - 'failure_count':49, - 'created':'>2022-11-30T23:15:04Z', - 'workflow_runs':[ +- `workflow_summary_report.txt`: a general report contains workflow pass/failure count, running + time, etc. + + ``` + 2023-03-03 01:37:07.114500 + Namespace(actor=None, branch=None, days=30, event='pull_request', folder='presubmit_30', jobs='all', repo_name='firebase-android-sdk', repo_owner='firebase', token=${your_github_token}, workflow_name='ci_tests.yml') + + Workflow 'ci_tests.yml' Report: + Workflow Failure Rate:64.77% + Workflow Total Count: 193 (success: 68, failure: 125) + + Workflow Runtime Report: + 161 workflow runs finished without rerun, the average running time: 0:27:24.745342 + Including: + 56 passed workflow runs, with average running time: 0:17:29.214286 + 105 failed workflow runs, with average running time: 0:32:42.361905 + + 32 runs finished with rerun, the average running time: 1 day, 3:57:53.937500 + The running time for each workflow reruns are: + ['1 day, 2:24:32', '3:35:54', '3:19:14', '4 days, 6:10:50', '15:33:39', '1:57:21', '1:13:12', '1:55:18', '12 days, 21:51:29', '0:48:48', '0:45:28', '1:40:21', '2 days, 1:46:35', '19:47:16', '0:45:49', '2:22:36', '0:25:22', '0:55:30', '1:40:32', '1:10:05', '20:08:38', '0:31:03', '5 days, 9:19:25', '5:10:44', '1:20:57', '0:28:47', '1:52:44', '20:19:17', '0:35:15', '21:31:07', '3 days, 1:06:44', '3 days, 2:18:14'] + + Job Failure Report: + Unit Tests (:firebase-storage): + Failure Rate:54.61% + Total Count: 152 (success: 69, failure: 83) + Unit Tests (:firebase-messaging): + Failure Rate:35.37% + Total Count: 147 (success: 95, failure: 52) + ``` + +- Intermediate file `workflow_summary.json`: contains all the workflow runs and job information + attached to each workflow. + + ``` + { + 'workflow_name':'ci_tests.yml', + 'total_count':81, + 'success_count':32, + 'failure_count':49, + 'created':'>2022-11-30T23:15:04Z', + 'workflow_runs':[ + { + 'workflow_id':4296343867, + 'conclusion':'failure', + 'head_branch':'master', + 'actor':'vkryachko', + 'created_at':'2023-02-28T18:47:40Z', + 'updated_at':'2023-02-28T19:20:16Z', + 'run_started_at':'2023-02-28T18:47:40Z', + 'run_attempt':1, + 'html_url':'https://github.com/firebase/firebase-android-sdk/actions/runs/4296343867', + 'jobs_url':'https://api.github.com/repos/firebase/firebase-android-sdk/actions/runs/4296343867/jobs', + 'jobs':{ + 'total_count':95, + 'success_count':92, + 'failure_count':3, + 'job_runs':[ + { + 'job_id':11664775180, + 'job_name':'Determine changed modules', + 'conclusion':'success', + 'created_at':'2023-02-28T18:47:42Z', + 'started_at':'2023-02-28T18:47:50Z', + 'completed_at':'2023-02-28T18:50:11Z', + 'run_attempt': 1, + 'html_url':'https://github.com/firebase/firebase-android-sdk/actions/runs/4296343867/jobs/7487936863', + } + ] + } + } + ] + } + ``` + +- Intermediate file `job_summary.json`: contains all the job runs organized by job name. + ``` + { + 'Unit Test Results':{ # job name + 'total_count':17, + 'success_count':7, + 'failure_count':10, + 'failure_jobs':[ # data structure is the same as same as workflow_summary['workflow_runs']['job_runs'] { - 'workflow_id':4296343867, + 'job_id':11372664143, + 'job_name':'Unit Test Results', 'conclusion':'failure', - 'head_branch':'master', - 'actor':'vkryachko', - 'created_at':'2023-02-28T18:47:40Z', - 'updated_at':'2023-02-28T19:20:16Z', - 'run_started_at':'2023-02-28T18:47:40Z', - 'run_attempt':1, - 'html_url':'https://github.com/firebase/firebase-android-sdk/actions/runs/4296343867', - 'jobs_url':'https://api.github.com/repos/firebase/firebase-android-sdk/actions/runs/4296343867/jobs', - 'jobs':{ - 'total_count':95, - 'success_count':92, - 'failure_count':3, - 'job_runs':[ - { - 'job_id':11664775180, - 'job_name':'Determine changed modules', - 'conclusion':'success', - 'created_at':'2023-02-28T18:47:42Z', - 'started_at':'2023-02-28T18:47:50Z', - 'completed_at':'2023-02-28T18:50:11Z', - 'run_attempt': 1, - 'html_url':'https://github.com/firebase/firebase-android-sdk/actions/runs/4296343867/jobs/7487936863', - } - ] - } + 'created_at':'2023-02-15T22:02:06Z', + 'started_at':'2023-02-15T22:02:06Z', + 'completed_at':'2023-02-15T22:02:06Z', + 'run_attempt': 1, + 'html_url':'https://github.com/firebase/firebase-android-sdk/runs/11372664143', } ] } - ``` - -- Intermediate file `job_summary.json`: contains all the job runs organized by job name. - ``` - { - 'Unit Test Results':{ # job name - 'total_count':17, - 'success_count':7, - 'failure_count':10, - 'failure_jobs':[ # data structure is the same as same as workflow_summary['workflow_runs']['job_runs'] - { - 'job_id':11372664143, - 'job_name':'Unit Test Results', - 'conclusion':'failure', - 'created_at':'2023-02-15T22:02:06Z', - 'started_at':'2023-02-15T22:02:06Z', - 'completed_at':'2023-02-15T22:02:06Z', - 'run_attempt': 1, - 'html_url':'https://github.com/firebase/firebase-android-sdk/runs/11372664143', - } - ] - } - } - ``` - + } + ``` # `collect_ci_test_logs.py` Script ## Usage -- Collect `ci_test.yml` job failure logs from `workflow_information.py` script's intermediate file: - ``` - python collect_ci_test_logs.py --token ${github_toke} --folder ${folder} - ``` + +- Collect `ci_test.yml` job failure logs from `workflow_information.py` script's intermediate file: + ``` + python collect_ci_test_logs.py --token ${github_toke} --folder ${folder} + ``` ## Inputs -- `-t, --token`: **[Required]** GitHub access token. See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). +- `-t, --token`: **[Required]** GitHub access token. See + [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). -- `-f, --folder`: **[Required]** Folder that store intermediate files generated by `workflow_information.py`. `ci_workflow.yml` job failure logs will also be stored here. +- `-f, --folder`: **[Required]** Folder that store intermediate files generated by + `workflow_information.py`. `ci_workflow.yml` job failure logs will also be stored here. ## Outputs -- `${job name}.log`: contains job failure rate, list all failed job links and failure logs. - ``` - Unit Tests (:firebase-storage): - Failure rate:40.00% - Total count: 20 (success: 12, failure: 8) - Failed jobs: - - https://github.com/firebase/firebase-android-sdk/actions/runs/4296343867/jobs/7487989874 - firebase-storage:testDebugUnitTest - Task :firebase-storage:testDebugUnitTest - 2023-02-28T18:54:38.1333725Z - 2023-02-28T18:54:38.1334278Z com.google.firebase.storage.DownloadTest > streamDownloadWithResumeAndCancel FAILED - 2023-02-28T18:54:38.1334918Z org.junit.ComparisonFailure at DownloadTest.java:190 - 2023-02-28T18:57:20.3329130Z - 2023-02-28T18:57:20.3330165Z 112 tests completed, 1 failed - 2023-02-28T18:57:20.5329189Z - 2023-02-28T18:57:20.5330505Z > Task :firebase-storage:testDebugUnitTest FAILED - ``` +- `${job name}.log`: contains job failure rate, list all failed job links and failure logs. + + ``` + Unit Tests (:firebase-storage): + Failure rate:40.00% + Total count: 20 (success: 12, failure: 8) + Failed jobs: + + https://github.com/firebase/firebase-android-sdk/actions/runs/4296343867/jobs/7487989874 + firebase-storage:testDebugUnitTest + Task :firebase-storage:testDebugUnitTest + 2023-02-28T18:54:38.1333725Z + 2023-02-28T18:54:38.1334278Z com.google.firebase.storage.DownloadTest > streamDownloadWithResumeAndCancel FAILED + 2023-02-28T18:54:38.1334918Z org.junit.ComparisonFailure at DownloadTest.java:190 + 2023-02-28T18:57:20.3329130Z + 2023-02-28T18:57:20.3330165Z 112 tests completed, 1 failed + 2023-02-28T18:57:20.5329189Z + 2023-02-28T18:57:20.5330505Z > Task :firebase-storage:testDebugUnitTest FAILED + ``` diff --git a/contributor-docs/README.md b/contributor-docs/README.md index c7b37f2b6f3..414b545bf72 100644 --- a/contributor-docs/README.md +++ b/contributor-docs/README.md @@ -5,8 +5,9 @@ permalink: / # Contributor documentation -This site is a collection of docs and best practices for contributors to Firebase Android SDKs. -It describes how Firebase works on Android and provides guidance on how to build/maintain a Firebase SDK. +This site is a collection of docs and best practices for contributors to Firebase Android SDKs. It +describes how Firebase works on Android and provides guidance on how to build/maintain a Firebase +SDK. ## New to Firebase? diff --git a/contributor-docs/best_practices/dependency_injection.md b/contributor-docs/best_practices/dependency_injection.md index 3b5de828998..1b900899bdb 100644 --- a/contributor-docs/best_practices/dependency_injection.md +++ b/contributor-docs/best_practices/dependency_injection.md @@ -5,38 +5,43 @@ parent: Best Practices # Dependency Injection While [Firebase Components]({{ site.baseurl }}{% link components/components.md %}) provides basic -Dependency Injection capabilities for interop between Firebase SDKs, it's not ideal as a general purpose -DI framework for a few reasons, to name some: +Dependency Injection capabilities for interop between Firebase SDKs, it's not ideal as a general +purpose DI framework for a few reasons, to name some: -* It's verbose, i.e. requires manually specifying dependencies and constructing instances of components in Component - definitions. -* It has a runtime cost, i.e. initialization time is linear in the number of Components present in the graph +- It's verbose, i.e. requires manually specifying dependencies and constructing instances of + components in Component definitions. +- It has a runtime cost, i.e. initialization time is linear in the number of Components present in + the graph -As a result using [Firebase Components]({{ site.baseurl }}{% link components/components.md %}) is appropriate only -for inter-SDK injection and scoping instances per `FirebaseApp`. +As a result using [Firebase Components]({{ site.baseurl }}{% link components/components.md %}) is +appropriate only for inter-SDK injection and scoping instances per `FirebaseApp`. -On the other hand, manually instantiating SDKs is often tedious, errorprone, and leads to code smells -that make code less testable and couples it to the implementation rather than the interface. For more context see -[Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) and [Motivation](https://github.com/google/guice/wiki/Motivation). +On the other hand, manually instantiating SDKs is often tedious, errorprone, and leads to code +smells that make code less testable and couples it to the implementation rather than the interface. +For more context see [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) and +[Motivation](https://github.com/google/guice/wiki/Motivation). -{: .important } -It's recommended to use [Dagger](https://dagger.dev) for internal dependency injection within the SDKs and -[Components]({{ site.baseurl }}{% link components/components.md %}) to inject inter-sdk dependencies that are available only at -runtime into the [Dagger Graph](https://dagger.dev/dev-guide/#building-the-graph) via -[builder setters](https://dagger.dev/dev-guide/#binding-instances) or [factory arguments](https://dagger.dev/api/latest/dagger/Component.Factory.html). +{: .important } It's recommended to use [Dagger](https://dagger.dev) for internal dependency +injection within the SDKs and [Components]({{ site.baseurl }}{% link components/components.md %}) to +inject inter-sdk dependencies that are available only at runtime into the +[Dagger Graph](https://dagger.dev/dev-guide/#building-the-graph) via +[builder setters](https://dagger.dev/dev-guide/#binding-instances) or +[factory arguments](https://dagger.dev/api/latest/dagger/Component.Factory.html). -See: [Dagger docs](https://dagger.dev) -See: [Dagger tutorial](https://dagger.dev/tutorial/) +See: [Dagger docs](https://dagger.dev) See: [Dagger tutorial](https://dagger.dev/tutorial/) -{: .highlight } -While Hilt is the recommended way to use dagger in Android applications, it's not suitable for SDK/library development. +{: .highlight } While Hilt is the recommended way to use dagger in Android applications, it's not +suitable for SDK/library development. ## How to get started -Since [Dagger](https://dagger.dev) does not strictly follow semver and requires the dagger-compiler version to match the dagger library version, -it's not safe to depend on it via a pom level dependency, see [This comment](https://github.com/firebase/firebase-android-sdk/issues/1677#issuecomment-645669608) for context. For this reason in Firebase SDKs we "vendor/repackage" Dagger into the SDK itself under -`com.google.firebase.{sdkname}.dagger`. While it incurs in a size increase, it's usually on the order of a couple of KB and is considered -negligible. +Since [Dagger](https://dagger.dev) does not strictly follow semver and requires the dagger-compiler +version to match the dagger library version, it's not safe to depend on it via a pom level +dependency, see +[This comment](https://github.com/firebase/firebase-android-sdk/issues/1677#issuecomment-645669608) +for context. For this reason in Firebase SDKs we "vendor/repackage" Dagger into the SDK itself under +`com.google.firebase.{sdkname}.dagger`. While it incurs in a size increase, it's usually on the +order of a couple of KB and is considered negligible. To use Dagger in your SDK use the following in your Gradle build file: @@ -56,10 +61,12 @@ dependencies { ## General Dagger setup -As mentioned in [Firebase Components]({{ site.baseurl }}{% link components/components.md %}), all components are scoped per `FirebaseApp` -meaning there is a single instance of the component within a given `FirebaseApp`. +As mentioned in [Firebase Components]({{ site.baseurl }}{% link components/components.md %}), all +components are scoped per `FirebaseApp` meaning there is a single instance of the component within a +given `FirebaseApp`. -This makes it a natural fit to get all inter-sdk dependencies and instatiate the Dagger component inside the `ComponentRegistrar`. +This makes it a natural fit to get all inter-sdk dependencies and instatiate the Dagger component +inside the `ComponentRegistrar`. ```kotlin class MyRegistrar : ComponentRegistrar { @@ -122,15 +129,17 @@ class MySdkInteropAdapter @Inject constructor(private val interop: com.google.fi ## Scope -Unlike Component, Dagger does not use singleton scope by default and instead injects a new instance of a type at each injection point, -in the example above we want `MySdk` and `MySdkInteropAdapter` to be singletons so they are are annotated with `@Singleton`. +Unlike Component, Dagger does not use singleton scope by default and instead injects a new instance +of a type at each injection point, in the example above we want `MySdk` and `MySdkInteropAdapter` to +be singletons so they are are annotated with `@Singleton`. -See [Scoped bindings](https://dagger.dev/dev-guide/#singletons-and-scoped-bindings) for more details. +See [Scoped bindings](https://dagger.dev/dev-guide/#singletons-and-scoped-bindings) for more +details. ### Support multiple instances of the SDK per `FirebaseApp`(multi-resource) -As mentioned in [Firebase Components]({{ site.baseurl }}{% link components/components.md %}), some SDKs support multi-resource mode, -which effectively means that there are 2 scopes at play: +As mentioned in [Firebase Components]({{ site.baseurl }}{% link components/components.md %}), some +SDKs support multi-resource mode, which effectively means that there are 2 scopes at play: 1. `@Singleton` scope that the main `MultiResourceComponent` has. 2. Each instance of the sdk will have its own scope. @@ -143,7 +152,7 @@ flowchart LR direction BT subgraph GlobalComponents[Outside of SDK] direction LR - + FirebaseOptions SomeInterop Executor["@Background Executor"] @@ -155,7 +164,7 @@ flowchart LR SomeImpl -.-> SomeInterop SomeImpl -.-> Executor end - + subgraph Default["@DbScope SDK(default)"] MainClassDefault[FirebaseDatabase] --> SomeImpl SomeOtherImplDefault[SomeOtherImpl] -.-> FirebaseOptions @@ -169,7 +178,7 @@ flowchart LR end end end - + classDef green fill:#4db6ac classDef blue fill:#1a73e8 class GlobalComponents green @@ -178,9 +187,11 @@ flowchart LR class MyDbName blue ``` -As you can see above, `DatabaseMultiDb` and `SomeImpl` are singletons, while `FirebaseDatabase` and `SomeOtherImpl` are scoped per `database name`. +As you can see above, `DatabaseMultiDb` and `SomeImpl` are singletons, while `FirebaseDatabase` and +`SomeOtherImpl` are scoped per `database name`. -It can be easily achieved with the help of [Dagger's subcomponents](https://dagger.dev/dev-guide/subcomponents). +It can be easily achieved with the help of +[Dagger's subcomponents](https://dagger.dev/dev-guide/subcomponents). For example: @@ -235,7 +246,7 @@ Implementing `DatabaseMultiDb`: @Singleton class DatabaseMultiDb @Inject constructor(private val factory: DbInstanceComponent.Factory) { private val instances = mutableMapOf() - + @Synchronized fun get(dbName: String) : FirebaseDatabase { if (!instances.containsKey(dbName)) { diff --git a/contributor-docs/components/components.md b/contributor-docs/components/components.md index de624274aab..816d71c7842 100644 --- a/contributor-docs/components/components.md +++ b/contributor-docs/components/components.md @@ -5,21 +5,22 @@ nav_order: 4 --- # Firebase Components + {: .no_toc} -1. TOC -{:toc} +1. TOC {:toc} -Firebase is known for being easy to use and requiring no/minimal configuration at runtime. -Just adding SDKs to the app makes them discover each other to provide additional functionality, -e.g. `Firestore` automatically integrates with `Auth` if present in the app. +Firebase is known for being easy to use and requiring no/minimal configuration at runtime. Just +adding SDKs to the app makes them discover each other to provide additional functionality, e.g. +`Firestore` automatically integrates with `Auth` if present in the app. -* Firebase SDKs have required and optional dependencies on other Firebase SDKs -* SDKs have different initialization requirements, e.g. `Analytics` and `Crashlytics` must be +- Firebase SDKs have required and optional dependencies on other Firebase SDKs +- SDKs have different initialization requirements, e.g. `Analytics` and `Crashlytics` must be initialized upon application startup, while some are initialized on demand only. -To accommodate these requirements Firebase uses a component model that discovers SDKs present in the app, -determines their dependencies and provides them to dependent SDKs via a `Dependency Injection` mechanism. +To accommodate these requirements Firebase uses a component model that discovers SDKs present in the +app, determines their dependencies and provides them to dependent SDKs via a `Dependency Injection` +mechanism. This page describes the aforementioned Component Model, how it works and why it's needed. @@ -27,17 +28,19 @@ This page describes the aforementioned Component Model, how it works and why it' ### Transparent/invisible to 3p Developers -To provide good developer experience, we don't want developers to think about how SDKs work and interoperate internally. -Instead we want our SDKs to have a simple API surface that hides all of the internal details. -Most products have an API surface that allows developers to get aninstance of a given SDK via `FirebaseFoo.getInstance()` -and start using it right away. +To provide good developer experience, we don't want developers to think about how SDKs work and +interoperate internally. Instead we want our SDKs to have a simple API surface that hides all of the +internal details. Most products have an API surface that allows developers to get aninstance of a +given SDK via `FirebaseFoo.getInstance()` and start using it right away. ### Simple to use and integrate with for component developers -* The component model is lightweight in terms of integration effort. It is not opinionated on how components are structured. -* The component model should require as little cooperation from components runtime as possible. -* It provides component developers with an API that is easy to use correctly, and hard to use incorrectly. -* Does not sacrifice testability of individual components in isolation +- The component model is lightweight in terms of integration effort. It is not opinionated on how + components are structured. +- The component model should require as little cooperation from components runtime as possible. +- It provides component developers with an API that is easy to use correctly, and hard to use + incorrectly. +- Does not sacrifice testability of individual components in isolation ### Performant at startup and initialization @@ -47,11 +50,12 @@ The runtime does as little work as possible during initialization. A Firebase Component is an entity that: -* Implements one or more interfaces -* Has a list of dependencies(required or optional). See [Dependencies]({{ site.baseurl }}{% link components/dependencies.md %}) -* Has initialization requirements(e.g. eager in default app) -* Defines a factory creates an instance of the component’s interface given it's dependencies. - (In other words describes how to create the given component.) +- Implements one or more interfaces +- Has a list of dependencies(required or optional). See + [Dependencies]({{ site.baseurl }}{% link components/dependencies.md %}) +- Has initialization requirements(e.g. eager in default app) +- Defines a factory creates an instance of the component’s interface given it's dependencies. (In + other words describes how to create the given component.) Example: @@ -66,11 +70,11 @@ Component auth = Component.builder(FirebaseAuth.class, InternalAut .build() ``` -All components are singletons within a Component Container(e.g. one instance per FirebaseApp). -There are however SDKs that need the ability to expose multiple objects per FirebaseApp, -for example RTBD(as well as Storage and Firestore) has multidb support which allows developers -to access one or more databases within one FirebaseApp. To address this requirement, -SDKs have to register their components in the following form(or similar): +All components are singletons within a Component Container(e.g. one instance per FirebaseApp). There +are however SDKs that need the ability to expose multiple objects per FirebaseApp, for example +RTBD(as well as Storage and Firestore) has multidb support which allows developers to access one or +more databases within one FirebaseApp. To address this requirement, SDKs have to register their +components in the following form(or similar): ```java // This is the singleton holder of different instances of FirebaseDatabase. @@ -80,18 +84,20 @@ interface RtdbComponent { } ``` -As you can see in the previous section, components are just values and don't have any behavior per se, -essentially they are just blueprints of how to create them and what dependencies they need. +As you can see in the previous section, components are just values and don't have any behavior per +se, essentially they are just blueprints of how to create them and what dependencies they need. -So there needs to be some ComponentRuntime that can discover and wire them together into a dependency graph, -in order to do that, there needs to be an agreed upon location where SDKs can register the components they provide. +So there needs to be some ComponentRuntime that can discover and wire them together into a +dependency graph, in order to do that, there needs to be an agreed upon location where SDKs can +register the components they provide. The next 2 sections describe how it's done. ## Component Registration -In order to define the `Components` an SDK provides, it needs to define a class that implements `ComponentRegistrar`, -this class contains all component definitions the SDK wants to register with the runtime: +In order to define the `Components` an SDK provides, it needs to define a class that implements +`ComponentRegistrar`, this class contains all component definitions the SDK wants to register with +the runtime: ```java public class MyRegistrar implements ComponentRegistrar { @@ -108,7 +114,8 @@ public class MyRegistrar implements ComponentRegistrar { ## Component Discovery -In addition to creating the `ComponentRegistrar` class, SDKs also need to add them to their `AndroidManifest.xml` under `ComponentDiscoveryService`: +In addition to creating the `ComponentRegistrar` class, SDKs also need to add them to their +`AndroidManifest.xml` under `ComponentDiscoveryService`: ```xml @@ -123,28 +130,32 @@ In addition to creating the `ComponentRegistrar` class, SDKs also need to add th ``` -When the final app is built, manifest registrar entries will all end up inside the above `service` as metadata key- value pairs. -At this point `FirebaseApp` will instantiate them and use the `ComponentRuntime` to construct the component graph. +When the final app is built, manifest registrar entries will all end up inside the above `service` +as metadata key- value pairs. At this point `FirebaseApp` will instantiate them and use the +`ComponentRuntime` to construct the component graph. ## Dependency resolution and initialization ### Definitions and constraints -* **Component A depends on Component B** if `B` depends on an `interface` that `A` implements. -* **For any Interface I, only one component is allowed to implement I**(with the exception of - [Set Dependencies]({{ site.baseurl }}{% link components/dependencies.md %}#set-dependencies)). If this invariant is violated, the container will - fail to start at runtime. -* **There must not be any dependency cycles** among components. See Dependency Cycle Resolution on how this limitation can - be mitigated -* **Components are initialized lazily by default**(unless a component is declared eager) and are initialized when requested - by an application either directly or transitively. +- **Component A depends on Component B** if `B` depends on an `interface` that `A` implements. +- **For any Interface I, only one component is allowed to implement I**(with the exception of [Set + Dependencies]({{ site.baseurl }}{% link components/dependencies.md %}#set-dependencies)). If this + invariant is violated, the container will fail to start at runtime. +- **There must not be any dependency cycles** among components. See Dependency Cycle Resolution on + how this limitation can be mitigated +- **Components are initialized lazily by default**(unless a component is declared eager) and are + initialized when requested by an application either directly or transitively. The initialization phase of the FirebaseApp will consist of the following steps: 1. Get a list of available FirebaseComponents that were discovered by the Discovery mechanism -2. Topologically sort components based on their declared dependencies - failing if a dependency cycle is detected or multiple implementations are registered for any interface. -3. Store a map of {iface -> ComponentFactory} so that components can be instantiated on demand(Note that component instantiation does not yet happen) -4. Initialize EAGER components or schedule them to initialize on device unlock, if in direct boot mode. +2. Topologically sort components based on their declared dependencies - failing if a dependency + cycle is detected or multiple implementations are registered for any interface. +3. Store a map of {iface -> ComponentFactory} so that components can be instantiated on demand(Note + that component instantiation does not yet happen) +4. Initialize EAGER components or schedule them to initialize on device unlock, if in direct boot + mode. ### Initialization example @@ -172,12 +183,12 @@ flowchart TD RemoteConfig --> FirebaseApp RemoteConfig --> Context RemoteConfig --> Installations - - + + classDef eager fill:#4db66e,stroke:#4db6ac,color:#000; classDef transitive fill:#4db6ac,stroke:#4db6ac,color:#000; classDef always fill:#1a73e8,stroke:#7baaf7,color:#fff; - + class Analytics eager class Crashlytics eager class Context always @@ -186,33 +197,37 @@ flowchart TD class Installations transitive ``` -There are **2 explicitly eager** components in this example: `Crashlytics` and `Analytics`. -These components are initialized when `FirebaseApp` is initialized. `Installations` is initialized eagerly because -eager components depends on it(see Prefer Lazy dependencies to avoid this as mush as possible). -`FirebaseApp`, `FirebaseOptions` and `Android Context` are always present in the Component Container and are considered initialized as well. +There are **2 explicitly eager** components in this example: `Crashlytics` and `Analytics`. These +components are initialized when `FirebaseApp` is initialized. `Installations` is initialized eagerly +because eager components depends on it(see Prefer Lazy dependencies to avoid this as mush as +possible). `FirebaseApp`, `FirebaseOptions` and `Android Context` are always present in the +Component Container and are considered initialized as well. -*The rest of the components are left uninitialized and will remain so until the client application requests them or an eager -component initializes them by using a Lazy dependency.* -For example, if the application calls `FirebaseDatabase.getInstance()`, the container will initialize `Auth` and `Database` -and will return `Database` to the user. +_The rest of the components are left uninitialized and will remain so until the client application +requests them or an eager component initializes them by using a Lazy dependency._ For example, if +the application calls `FirebaseDatabase.getInstance()`, the container will initialize `Auth` and +`Database` and will return `Database` to the user. ### Support multiple instances of the SDK per `FirebaseApp`(multi-resource) -Some SDKs support multi-resource mode of operation, where it's possible to create more than one instance per `FirebaseApp`. +Some SDKs support multi-resource mode of operation, where it's possible to create more than one +instance per `FirebaseApp`. Examples: -* RTDB allows more than one database in a single Firebase project, so it's possible to instantiate one instance of the sdk per datbase +- RTDB allows more than one database in a single Firebase project, so it's possible to instantiate + one instance of the sdk per datbase ```kotlin val rtdbOne = Firebase.database(app) // uses default database val rtdbTwo = Firebase.database(app, "dbName") ``` -* Firestore, functions, and others support the same usage pattern +- Firestore, functions, and others support the same usage pattern -To allow for that, such SDKs register a singleton "MultiResource" [Firebase component]({{ site.baseurl }}{% link components/components.md %}), -which creates instances per resource(e.g. db name). +To allow for that, such SDKs register a singleton "MultiResource" [Firebase +component]({{ site.baseurl }}{% link components/components.md %}), which creates instances per +resource(e.g. db name). Example @@ -236,7 +251,7 @@ class FirebaseDatabase( companion object { fun getInstance(app : FirebaseApp) = getInstance("default") - fun getInstance(app : FirebaseApp, dbName: String) = + fun getInstance(app : FirebaseApp, dbName: String) = app.get(DatabaseComponent::class.java).get("default") } diff --git a/contributor-docs/components/dependencies.md b/contributor-docs/components/dependencies.md index 587fe109ab1..b77fb34ab64 100644 --- a/contributor-docs/components/dependencies.md +++ b/contributor-docs/components/dependencies.md @@ -3,18 +3,18 @@ parent: Firebase Components --- # Dependencies + {: .no_toc} -1. TOC -{:toc} +1. TOC {:toc} This page gives an overview of the different dependency types supported by the Components Framework. ## Background -As discussed in [Firebase Components]({{ site.baseurl }}{% link components/components.md %}), in order -for a `Component` to be injected with the things it needs to function, it has to declare its dependencies. -These dependencies are then made available and injected into `Components` at runtime. +As discussed in [Firebase Components]({{ site.baseurl }}{% link components/components.md %}), in +order for a `Component` to be injected with the things it needs to function, it has to declare its +dependencies. These dependencies are then made available and injected into `Components` at runtime. Firebase Components provide different types of dependencies. @@ -34,15 +34,14 @@ class MyComponent(private val dep : MyDep) { } ``` -As you can see above the component's dependency is passed by value directly, -which means that the dependency needs to be fully initialized before -it's handed off to the requesting component. As a result `MyComponent` may have to pay the cost -of initializing `MyDep` just to be created. +As you can see above the component's dependency is passed by value directly, which means that the +dependency needs to be fully initialized before it's handed off to the requesting component. As a +result `MyComponent` may have to pay the cost of initializing `MyDep` just to be created. ### Lazy/Provider Injection -With this type of injection, instead of getting an instance of the dependency directly, the dependency -is passed into the `Component` with the help of a `com.google.firebase.inject.Provider` +With this type of injection, instead of getting an instance of the dependency directly, the +dependency is passed into the `Component` with the help of a `com.google.firebase.inject.Provider` ```java public interface Provider { T get(); } @@ -58,19 +57,22 @@ class MyComponent(private val dep : Provider) { } ``` -On the surface this does not look like a big change, but it has an important side effect. In order to create -an instance of `MyComponent`, we don't need to initialize `MyDep` anymore. Instead, initialization can be -delayed until `MyDep` is actually used. +On the surface this does not look like a big change, but it has an important side effect. In order +to create an instance of `MyComponent`, we don't need to initialize `MyDep` anymore. Instead, +initialization can be delayed until `MyDep` is actually used. -It is also benefitial to use a `Provider` in the context of [Play's dynamic feature delivery](https://developer.android.com/guide/playcore/feature-delivery). -See [Dynamic Module Support]({{ site.baseurl }}{% link components/dynamic_modules.md %}) for more details. +It is also benefitial to use a `Provider` in the context of +[Play's dynamic feature delivery](https://developer.android.com/guide/playcore/feature-delivery). +See [Dynamic Module Support]({{ site.baseurl }}{% link components/dynamic_modules.md %}) for more +details. ## Required dependencies -This type of dependency informs the `ComponentRuntime` that a given `Component` cannot function without a dependency. -When the dependency is missing during initialization, `ComponentRuntime` will throw a `MissingDependencyException`. -This type of dependency is useful for built-in components that are always present like `Context`, `FirebaseApp`, -`FirebaseOptions`, [Executors]({{ site.baseurl }}{% link components/executors.md %}). +This type of dependency informs the `ComponentRuntime` that a given `Component` cannot function +without a dependency. When the dependency is missing during initialization, `ComponentRuntime` will +throw a `MissingDependencyException`. This type of dependency is useful for built-in components that +are always present like `Context`, `FirebaseApp`, `FirebaseOptions`, +[Executors]({{ site.baseurl }}{% link components/executors.md %}). To declare a required dependency use one of the following in your `ComponentRegistrar`: @@ -85,9 +87,9 @@ To declare a required dependency use one of the following in your `ComponentRegi ## Optional Dependencies -This type of dependencies is useful when your `Component` can operate normally when the dependency is not -available, but can have enhanced functionality when present. e.g. `Firestore` can work without `Auth` but -provides secure database access when `Auth` is present. +This type of dependencies is useful when your `Component` can operate normally when the dependency +is not available, but can have enhanced functionality when present. e.g. `Firestore` can work +without `Auth` but provides secure database access when `Auth` is present. To declare an optional dependency use the following in your `ComponentRegistrar`: @@ -99,24 +101,26 @@ To declare an optional dependency use the following in your `ComponentRegistrar` The provider will return `null` if the dependency is not present in the app. -{: .warning } -When the app uses [Play's dynamic feature delivery](https://developer.android.com/guide/playcore/feature-delivery), -`provider.get()` will return your dependency when it becomes available. To support this use case, don't store references to the result of `provider.get()` calls. +{: .warning } When the app uses +[Play's dynamic feature delivery](https://developer.android.com/guide/playcore/feature-delivery), +`provider.get()` will return your dependency when it becomes available. To support this use case, +don't store references to the result of `provider.get()` calls. See [Dynamic Module Support]({{ site.baseurl }}{% link components/dynamic_modules.md %}) for details -{: .warning } -See Deferred dependencies if you your dependency has a callback based API +{: .warning } See Deferred dependencies if you your dependency has a callback based API ## Deferred Dependencies -Useful for optional dependencies which have a listener-style API, i.e. the dependent component registers a -listener with the dependency and never calls it again (instead the dependency will call the registered listener). -A good example is `Firestore`'s use of `Auth`, where `Firestore` registers a token change listener to get -notified when a new token is available. The problem is that when `Firestore` initializes, `Auth` may not be -present in the app, and is instead part of a dynamic module that can be loaded at runtime on demand. +Useful for optional dependencies which have a listener-style API, i.e. the dependent component +registers a listener with the dependency and never calls it again (instead the dependency will call +the registered listener). A good example is `Firestore`'s use of `Auth`, where `Firestore` registers +a token change listener to get notified when a new token is available. The problem is that when +`Firestore` initializes, `Auth` may not be present in the app, and is instead part of a dynamic +module that can be loaded at runtime on demand. -To solve this problem, Components have a notion of a `Deferred` dependency. A deferred is defined as follows: +To solve this problem, Components have a notion of a `Deferred` dependency. A deferred is defined as +follows: ```java public interface Deferred { @@ -145,7 +149,8 @@ See [Dynamic Module Support]({{ site.baseurl }}{% link components/dynamic_module ## Set Dependencies -The Components Framework allows registering components to be part of a set, such components are registered explicitly to be a part of a `Set` as opposed to be a unique value of `T`: +The Components Framework allows registering components to be part of a set, such components are +registered explicitly to be a part of a `Set` as opposed to be a unique value of `T`: ```java // Sdk 1 @@ -157,21 +162,22 @@ Component.intoSetBuilder(SomeType.class) .build(); ``` -With the above setup each SDK contributes a value of `SomeType` into a `Set` which becomes available as a -`Set` dependency. +With the above setup each SDK contributes a value of `SomeType` into a `Set` which becomes +available as a `Set` dependency. -To consume such a set the interested `Component` needs to declare a special kind of dependency in one of 2 ways: +To consume such a set the interested `Component` needs to declare a special kind of dependency in +one of 2 ways: -* `Dependency.setOf(SomeType.class)`, a dependency of type `Set`. -* `Dependency.setOfProvider(SomeType.class)`, a dependency of type `Provider>`. The advantage of this - is that the `Set` is not initialized until the first call to `provider.get()` at which point all elements of the - set will get initialized. +- `Dependency.setOf(SomeType.class)`, a dependency of type `Set`. +- `Dependency.setOfProvider(SomeType.class)`, a dependency of type `Provider>`. The + advantage of this is that the `Set` is not initialized until the first call to `provider.get()` at + which point all elements of the set will get initialized. -{: .warning } -Similar to optional `Provider` dependencies, where an optional dependency can become available at runtime due to +{: .warning } Similar to optional `Provider` dependencies, where an optional dependency can become +available at runtime due to [Play's dynamic feature delivery](https://developer.android.com/guide/playcore/feature-delivery), -`Set` dependencies can change at runtime by new elements getting added to the set. -So make sure to hold on to the original `Set` to be able to observe new values in it as they are added. +`Set` dependencies can change at runtime by new elements getting added to the set. So make sure to +hold on to the original `Set` to be able to observe new values in it as they are added. Example: diff --git a/contributor-docs/components/executors.md b/contributor-docs/components/executors.md index f7fdc7c3a7b..f8aea35a476 100644 --- a/contributor-docs/components/executors.md +++ b/contributor-docs/components/executors.md @@ -3,20 +3,22 @@ parent: Firebase Components --- # Executors + {: .no_toc} -1. TOC -{:toc} +1. TOC {:toc} ## Intro -OS threads are a limited resource that needs to be used with care. In order to minimize the number of threads used by Firebase -as a whole and to increase resource sharing Firebase Common provides a set of standard -[executors](https://developer.android.com/reference/java/util/concurrent/Executor) -and [coroutine dispatchers](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/) +OS threads are a limited resource that needs to be used with care. In order to minimize the number +of threads used by Firebase as a whole and to increase resource sharing Firebase Common provides a +set of standard [executors](https://developer.android.com/reference/java/util/concurrent/Executor) +and +[coroutine dispatchers](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/) for use by all Firebase SDKs. -These executors are available as components and can be requested by product SDKs as component dependencies. +These executors are available as components and can be requested by product SDKs as component +dependencies. Example: @@ -25,7 +27,7 @@ public class MyRegistrar implements ComponentRegistrar { public List> getComponents() { Qualified backgroundExecutor = Qualified.qualified(Background.class, Executor.class); Qualified liteExecutorService = Qualified.qualified(Lightweight.class, ExecutorService.class); - + return Collections.singletonList( Component.builder(MyComponent.class) .add(Dependency.required(backgroundExecutor)) @@ -38,17 +40,17 @@ public class MyRegistrar implements ComponentRegistrar { All executors(with the exception of `@UiThread`) are available as the following interfaces: -* `Executor` -* `ExecutorService` -* `ScheduledExecutorService` -* `CoroutineDispatcher` +- `Executor` +- `ExecutorService` +- `ScheduledExecutorService` +- `CoroutineDispatcher` `@UiThread` is provided only as a plain `Executor`. ### Validation -All SDKs have a custom linter check that detects creation of thread pools and threads, -this is to ensure SDKs use the above executors instead of creating their own. +All SDKs have a custom linter check that detects creation of thread pools and threads, this is to +ensure SDKs use the above executors instead of creating their own. ## Choose the right executor @@ -65,17 +67,17 @@ flowchart TD DoesBlock --> |Yes| DiskIO{Does it block only\n on disk IO?} DiskIO --> |Yes| BgExecutor DiskIO --> |No| BlockExecutor[[Blocking Executor]] - - + + classDef start fill:#4db6ac,stroke:#4db6ac,color:#000; class Start start - + classDef condition fill:#f8f9fa,stroke:#bdc1c6,color:#000; class DoesBlock condition; class NeedUi condition; class TakesLong condition; class DiskIO condition; - + classDef executor fill:#1a73e8,stroke:#7baaf7,color:#fff; class UiExecutor executor; class LiteExecutor executor; @@ -85,7 +87,8 @@ flowchart TD ### UiThread -Used to schedule tasks on application's UI thread, internally it uses a Handler to post runnables onto the main looper. +Used to schedule tasks on application's UI thread, internally it uses a Handler to post runnables +onto the main looper. Example: @@ -101,8 +104,8 @@ Qualified dispatcher = qualified(UiThread::class.java, Coro ### Lightweight -Use for tasks that never block and don't take to long to execute. Backed by a thread pool of N threads -where N is the amount of parallelism available on the device(number of CPU cores) +Use for tasks that never block and don't take to long to execute. Backed by a thread pool of N +threads where N is the amount of parallelism available on the device(number of CPU cores) Example: @@ -118,8 +121,8 @@ Qualified dispatcher = qualified(Lightweight::class.java, C ### Background -Use for tasks that may block on disk IO(use `@Blocking` for network IO or blocking on other threads). -Backed by 4 threads. +Use for tasks that may block on disk IO(use `@Blocking` for network IO or blocking on other +threads). Backed by 4 threads. Example: @@ -153,8 +156,8 @@ Qualified dispatcher = qualified(Blocking::class.java, Coro #### Direct executor -{: .warning } -Prefer `@Lightweight` instead of using direct executor as it could cause dead locks and stack overflows. +{: .warning } Prefer `@Lightweight` instead of using direct executor as it could cause dead locks +and stack overflows. For any trivial tasks that don't need to run asynchronously @@ -166,7 +169,9 @@ FirebaseExecutors.directExecutor() #### Sequential Executor -When you need an executor that runs tasks sequentially and guarantees any memory access is synchronized prefer to use a sequential executor instead of creating a `newSingleThreadedExecutor()`. +When you need an executor that runs tasks sequentially and guarantees any memory access is +synchronized prefer to use a sequential executor instead of creating a +`newSingleThreadedExecutor()`. Example: @@ -179,13 +184,13 @@ Executor sequentialExecutor = FirebaseExecutors.newSequentialExecutor(c.get(bgEx ## Proper Kotlin usage -A `CoroutineContext` should be preferred when possible over an explicit `Executor` -or `CoroutineDispatcher`. You should only use an `Executor` at the highest -(or inversely the lowest) level of your implementations. Most classes should not -be concerned with the existence of an `Executor`. +A `CoroutineContext` should be preferred when possible over an explicit `Executor` or +`CoroutineDispatcher`. You should only use an `Executor` at the highest (or inversely the lowest) +level of your implementations. Most classes should not be concerned with the existence of an +`Executor`. -Keep in mind that you can combine `CoroutineContext` with other `CoroutineScope` -or `CoroutineContext`. And that all `suspend` functions inherent their `coroutineContext`: +Keep in mind that you can combine `CoroutineContext` with other `CoroutineScope` or +`CoroutineContext`. And that all `suspend` functions inherent their `coroutineContext`: ```kotlin suspend fun createSession(): Session { @@ -202,20 +207,19 @@ To learn more, you should give the following Kotlin wiki page a read: ### Using Executors in tests -`@Lightweight` and `@Background` executors have StrictMode enabled and throw exceptions on violations. -For example trying to do Network IO on either of them will throw. -With that in mind, when it comes to writing tests, prefer to use the common executors as opposed to creating -your own thread pools. This will ensure that your code uses the appropriate executor and does not slow down +`@Lightweight` and `@Background` executors have StrictMode enabled and throw exceptions on +violations. For example trying to do Network IO on either of them will throw. With that in mind, +when it comes to writing tests, prefer to use the common executors as opposed to creating your own +thread pools. This will ensure that your code uses the appropriate executor and does not slow down all of Firebase by using the wrong one. -To do that, you should prefer relying on Components to inject the right executor even in tests. -This will ensure your tests are always using the executor that is actually used in your SDK build. -If your SDK uses Dagger, see [Dependency Injection]({{ site.baseurl }}{% link -best_practices/dependency_injection.md %}) -and [Dagger's testing guide](https://dagger.dev/dev-guide/testing). +To do that, you should prefer relying on Components to inject the right executor even in tests. This +will ensure your tests are always using the executor that is actually used in your SDK build. If +your SDK uses Dagger, see [Dependency Injection]({{ site.baseurl }}{% link +best_practices/dependency_injection.md %}) and [Dagger's testing guide](https://dagger.dev/dev-guide/testing). -When the above is not an option, you can use `TestOnlyExecutors`, but make sure you're testing your code with -the same executor that is used in production code: +When the above is not an option, you can use `TestOnlyExecutors`, but make sure you're testing your +code with the same executor that is used in production code: ```kotlin dependencies { @@ -237,35 +241,34 @@ TestOnlyExecutors.lite(); ### Policy violations in tests -Unit tests require [Robolectric](https://github.com/robolectric/robolectric) to -function correctly, and this comes with a major drawback; no policy validation. +Unit tests require [Robolectric](https://github.com/robolectric/robolectric) to function correctly, +and this comes with a major drawback; no policy validation. -Robolectric supports `StrictMode`- but does not provide the backing for its -policy mechanisms to fire on violations. As such, you'll be able to do things -like using `TestOnlyExecutors.background()` to execute blocking actions; usage -that would have otherwise crashed in a real application. +Robolectric supports `StrictMode`- but does not provide the backing for its policy mechanisms to +fire on violations. As such, you'll be able to do things like using `TestOnlyExecutors.background()` +to execute blocking actions; usage that would have otherwise crashed in a real application. -Unfortunately, there is no easy way to fix this for unit tests. You can get -around the issue by moving the tests to an emulator (integration tests)- but -those can be more expensive than your standard unit test, so you may want to -take that into consideration when planning your testing strategy. +Unfortunately, there is no easy way to fix this for unit tests. You can get around the issue by +moving the tests to an emulator (integration tests)- but those can be more expensive than your +standard unit test, so you may want to take that into consideration when planning your testing +strategy. ### StandardTestDispatcher support The [kotlin.coroutines.test](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/) -library provides support for a number of different mechanisms in tests. Some of the more -famous features include: +library provides support for a number of different mechanisms in tests. Some of the more famous +features include: - [advanceUntilIdle](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scheduler/advance-until-idle.html) - [advanceTimeBy](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scheduler/advance-time-by.html) - [runCurrent](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scheduler/run-current.html) -These features are all backed by `StandardTestDispatcher`, or more appropriately, -the `TestScope` provided in a `runTest` block. +These features are all backed by `StandardTestDispatcher`, or more appropriately, the `TestScope` +provided in a `runTest` block. -Unfortunately, `TestOnlyExecutors` does not natively bind with `TestScope`. -Meaning, should you use `TestOnlyExecutors` in your tests- you won't be able to utilize -the features provided by `TestScope`: +Unfortunately, `TestOnlyExecutors` does not natively bind with `TestScope`. Meaning, should you use +`TestOnlyExecutors` in your tests- you won't be able to utilize the features provided by +`TestScope`: ```kotlin @Test @@ -279,9 +282,8 @@ fun doesStuff() = runTest { } ``` -To help fix this, we provide an extension method on `TestScope` called -`firebaseExecutors`. It facilitates the binding of `TestOnlyExecutors` with the -current `TestScope`. +To help fix this, we provide an extension method on `TestScope` called `firebaseExecutors`. It +facilitates the binding of `TestOnlyExecutors` with the current `TestScope`. For example, here's how you could use this extension method in a test: @@ -295,4 +297,4 @@ fun doesStuff() = runTest { runCurrent() } -``` \ No newline at end of file +``` diff --git a/contributor-docs/how_firebase_works.md b/contributor-docs/how_firebase_works.md index 3d20eeb2374..bbfba97012e 100644 --- a/contributor-docs/how_firebase_works.md +++ b/contributor-docs/how_firebase_works.md @@ -8,54 +8,74 @@ nav_order: 3 ### Eager Initialization -One of the biggest strengths for Firebase clients is the ease of integration. In a common case, a developer has very few things to do to integrate with Firebase. There is no need to initialize/configure Firebase at runtime. Firebase automatically initializes at application start and begins providing value to developers. A few notable examples: +One of the biggest strengths for Firebase clients is the ease of integration. In a common case, a +developer has very few things to do to integrate with Firebase. There is no need to +initialize/configure Firebase at runtime. Firebase automatically initializes at application start +and begins providing value to developers. A few notable examples: -* `Analytics` automatically tracks app events -* `Firebase Performance` automatically tracks app startup time, all network requests and screen performance -* `Crashlytics` automatically captures all application crashes, ANRs and non-fatals +- `Analytics` automatically tracks app events +- `Firebase Performance` automatically tracks app startup time, all network requests and screen + performance +- `Crashlytics` automatically captures all application crashes, ANRs and non-fatals -This feature makes onboarding and adoption very simple. However, comes with the great responsibility of keeping the application snappy. We shouldn't slow down application startup for 3p developers as it can stand in the way of user adoption of their application. +This feature makes onboarding and adoption very simple. However, comes with the great responsibility +of keeping the application snappy. We shouldn't slow down application startup for 3p developers as +it can stand in the way of user adoption of their application. ### Automatic Inter-Product Discovery -When present together in an application, Firebase products can detect each other and automatically provide additional functionality to the developer, e.g.: +When present together in an application, Firebase products can detect each other and automatically +provide additional functionality to the developer, e.g.: -* `Firestore` automatically detects `Auth` and `AppCheck` to protect read/write access to the database -* `Crashlytics` integrates with `Analytics`, when available, to provide additional insights into the application behavior and enables safe app rollouts +- `Firestore` automatically detects `Auth` and `AppCheck` to protect read/write access to the + database +- `Crashlytics` integrates with `Analytics`, when available, to provide additional insights into the + application behavior and enables safe app rollouts ## FirebaseApp at the Core of Firebase -Regardless of what Firebase SDKs are present in the app, the main initialization point of Firebase is `FirebaseApp`. It acts as a container for all SDKs, manages their configuration, initialization and lifecycle. +Regardless of what Firebase SDKs are present in the app, the main initialization point of Firebase +is `FirebaseApp`. It acts as a container for all SDKs, manages their configuration, initialization +and lifecycle. ### Initialization -`FirebaseApp` gets initialized with the help of `FirebaseApp#initializeApp()`. This happens [automatically at app startup](https://firebase.blog/posts/2016/12/how-does-firebase-initialize-on-android) or manually by the developer. +`FirebaseApp` gets initialized with the help of `FirebaseApp#initializeApp()`. This happens +[automatically at app startup](https://firebase.blog/posts/2016/12/how-does-firebase-initialize-on-android) +or manually by the developer. -During initialization, `FirebaseApp` discovers all Firebase SDKs present in the app, determines the dependency graph between products(for inter-product functionality) and initializes `eager` products that need to start immediately, e.g. `Crashlytics` and `FirebasePerformance`. +During initialization, `FirebaseApp` discovers all Firebase SDKs present in the app, determines the +dependency graph between products(for inter-product functionality) and initializes `eager` products +that need to start immediately, e.g. `Crashlytics` and `FirebasePerformance`. ### Firebase Configuration -`FirebaseApp` contains Firebase configuration for all products to use, namely `FirebaseOptions`, which tells Firebase which `Firebase` project to talk to, which real-time database to use, etc. +`FirebaseApp` contains Firebase configuration for all products to use, namely `FirebaseOptions`, +which tells Firebase which `Firebase` project to talk to, which real-time database to use, etc. ### Additional Services/Components -In addition to `FirebaseOptions`, `FirebaseApp` registers additional components that product SDKs can request via dependency injection. To name a few: +In addition to `FirebaseOptions`, `FirebaseApp` registers additional components that product SDKs +can request via dependency injection. To name a few: -* `android.content.Context`(Application context) -* [Common Executors]({{ site.baseurl }}{% link components/executors.md %}) -* `FirebaseOptions` -* Various internal components +- `android.content.Context`(Application context) +- [Common Executors]({{ site.baseurl }}{% link components/executors.md %}) +- `FirebaseOptions` +- Various internal components ## Discovery and Dependency Injection There are multiple considerations that lead to the current design of how Firebase SDKs initialize. 1. Certain SDKs need to initialize at app startup. -2. SDKs have optional dependencies on other products that get enabled when the developer adds the dependency to their app. +2. SDKs have optional dependencies on other products that get enabled when the developer adds the + dependency to their app. -To enable this functionality, Firebase uses a runtime discovery and dependency injection framework [firebase-components](https://github.com/firebase/firebase-android-sdk/tree/main/firebase-components). +To enable this functionality, Firebase uses a runtime discovery and dependency injection framework +[firebase-components](https://github.com/firebase/firebase-android-sdk/tree/main/firebase-components). -To integrate with this framework SDKs register the components they provide via a `ComponentRegistrar` and declare any dependencies they need to initialize, e.g. +To integrate with this framework SDKs register the components they provide via a +`ComponentRegistrar` and declare any dependencies they need to initialize, e.g. ```java public class MyRegistrar implements ComponentRegistrar { @@ -80,6 +100,7 @@ public class MyRegistrar implements ComponentRegistrar { } ``` -This registrar is then registered in `AndroidManifest.xml` of the SDK and is used by `FirebaseApp` to discover all components and construct the dependency graph. +This registrar is then registered in `AndroidManifest.xml` of the SDK and is used by `FirebaseApp` +to discover all components and construct the dependency graph. More details in [Firebase Components]({{ site.baseurl }}{% link components/components.md %}). diff --git a/contributor-docs/onboarding/env_setup.md b/contributor-docs/onboarding/env_setup.md index 95427f8a66a..871cb910293 100644 --- a/contributor-docs/onboarding/env_setup.md +++ b/contributor-docs/onboarding/env_setup.md @@ -5,36 +5,33 @@ parent: Onboarding # Development Environment Setup This page describes software and configuration required to work on code in the -[Firebase/firebase-android-sdk](https://github.com/firebase/firebase-android-sdk) -repository. +[Firebase/firebase-android-sdk](https://github.com/firebase/firebase-android-sdk) repository. {:toc} ## JDK -The currently required version of the JDK is `11`. Any other versions are -unsupported and using them could result in build failures. +The currently required version of the JDK is `11`. Any other versions are unsupported and using them +could result in build failures. ## Android Studio -In general, the most recent version of Android Studio should work. The version -that is tested at the time of this writing is `Dolphin | 2021.3.1`. +In general, the most recent version of Android Studio should work. The version that is tested at the +time of this writing is `Dolphin | 2021.3.1`. -Download it here: -[Download Android Studio](https://developer.android.com/studio) +Download it here: [Download Android Studio](https://developer.android.com/studio) ## Emulators -If you plan to run tests on emulators(you should), you should be able to install -them directly from Android Studio's AVD manager. +If you plan to run tests on emulators(you should), you should be able to install them directly from +Android Studio's AVD manager. ## Github (Googlers Only) -To onboard and get write access to the github repository you need to have a -github account fully linked with [go/github](http://go/github). +To onboard and get write access to the github repository you need to have a github account fully +linked with [go/github](http://go/github). -File a bug using this -[bug template](http://b/issues/new?component=312729&template=1016566) and wait +File a bug using this [bug template](http://b/issues/new?component=312729&template=1016566) and wait for access to be granted. After that configure github keys as usual using this @@ -42,9 +39,9 @@ After that configure github keys as usual using this ## Importing the repository -1. Clone the repository with `git clone --recurse-submodules - git@github.com:firebase/firebase-android-sdk.git`. +1. Clone the repository with + `git clone --recurse-submodules git@github.com:firebase/firebase-android-sdk.git`. 1. Open Android Studio and click "Open an existing project". - ![Open an existing project](as_open_project.png) + ![Open an existing project](as_open_project.png) 1. Find the `firebase-android-sdk` directory and open. 1. To run integration/device tests you will need a `google-services.json` file. diff --git a/contributor-docs/onboarding/new_sdk.md b/contributor-docs/onboarding/new_sdk.md index 2d39b001d62..6dd619bb6e8 100644 --- a/contributor-docs/onboarding/new_sdk.md +++ b/contributor-docs/onboarding/new_sdk.md @@ -3,23 +3,22 @@ parent: Onboarding --- # Creating a new Firebase SDK + {: .no_toc} -1. TOC -{:toc} +1. TOC {:toc} Want to create a new SDK in -[firebase/firebase-android-sdk](https://github.com/firebase/firebase-android-sdk)? -Read on. +[firebase/firebase-android-sdk](https://github.com/firebase/firebase-android-sdk)? Read on. {:toc} ## Repository layout and Gradle -[firebase/firebase-android-sdk](https://github.com/firebase/firebase-android-sdk) -uses a multi-project Gradle build to organize the different libraries it hosts. -As a consequence, each project/product within this repo is hosted under its own -subdirectory with its respective build file(s). +[firebase/firebase-android-sdk](https://github.com/firebase/firebase-android-sdk) uses a +multi-project Gradle build to organize the different libraries it hosts. As a consequence, each +project/product within this repo is hosted under its own subdirectory with its respective build +file(s). ```bash firebase-android-sdk @@ -35,21 +34,17 @@ firebase-android-sdk └── build.gradle # root project build file. ``` -Most commonly, SDKs are located as immediate child directories of the root -directory, with the directory name being the exact name of the Maven artifact ID -the library will have once released. e.g. `firebase-common` directory -hosts code for the `com.google.firebase:firebase-common` SDK. +Most commonly, SDKs are located as immediate child directories of the root directory, with the +directory name being the exact name of the Maven artifact ID the library will have once released. +e.g. `firebase-common` directory hosts code for the `com.google.firebase:firebase-common` SDK. -{: .warning } -Note that the build file name for any given SDK is not `build.gradle` or `build.gradle.kts` -but rather mirrors the name of the sdk, e.g. +{: .warning } Note that the build file name for any given SDK is not `build.gradle` or +`build.gradle.kts` but rather mirrors the name of the sdk, e.g. `firebase-common/firebase-common.gradle` or `firebase-common/firebase-common.gradle.kts`. -All of the core Gradle build logic lives in `plugins` and is used by all -SDKs. +All of the core Gradle build logic lives in `plugins` and is used by all SDKs. -SDKs can be grouped together for convenience by placing them in a directory of -choice. +SDKs can be grouped together for convenience by placing them in a directory of choice. ## Creating an SDK @@ -72,34 +67,21 @@ plugins { // id("kotlin-android") } -firebaseLibrary { - // enable this only if you have tests in `androidTest`. - testLab.enabled = true - publishJavadoc = true -} +firebaseLibrary { // enable this only if you have tests in `androidTest`. testLab.enabled = true +publishJavadoc = true } -android { - val targetSdkVersion : Int by rootProject - val minSdkVersion : Int by rootProject - - compileSdk = targetSdkVersion - defaultConfig { - namespace = "com.google.firebase.foo" - // change this if you have custom needs. - minSdk = minSdkVersion - targetSdk = targetSdkVersion - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } +android { val targetSdkVersion : Int by rootProject val minSdkVersion : Int by rootProject - testOptions.unitTests.isIncludeAndroidResources = true -} +compileSdk = targetSdkVersion defaultConfig { namespace = "com.google.firebase.foo" // change this +if you have custom needs. minSdk = minSdkVersion targetSdk = targetSdkVersion +testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } -dependencies { - implementation("com.google.firebase:firebase-common:21.0.0") - implementation("com.google.firebase:firebase-components:18.0.0") -} +testOptions.unitTests.isIncludeAndroidResources = true } -``` +dependencies { implementation("com.google.firebase:firebase-common:21.0.0") +implementation("com.google.firebase:firebase-components:18.0.0") } + +```` ### Create `src/main/AndroidManifest.xml` with the following content: @@ -134,13 +116,14 @@ dependencies { -``` +```` ### Create `com.google.firebase.foo.FirebaseFoo` For Kotlin +
src/main/kotlin/com/google/firebase/foo/FirebaseFoo.kt @@ -161,6 +144,7 @@ class FirebaseFoo {
For Java +
src/main/java/com/google/firebase/foo/FirebaseFoo.java @@ -182,14 +166,15 @@ public class FirebaseFoo { ### Create `com.google.firebase.foo.FirebaseFooRegistrar` For Kotlin +
src/main/kotlin/com/google/firebase/foo/FirebaseFooRegistrar.kt -{: .warning } -You should strongly consider using [Dependency Injection]({{ site.baseurl }}{% link best_practices/dependency_injection.md %}) -to instantiate your sdk instead of manually constructing its instance in the `factory()` below. +{: .warning } You should strongly consider using [Dependency +Injection]({{ site.baseurl }}{% link best_practices/dependency_injection.md %}) to instantiate your +sdk instead of manually constructing its instance in the `factory()` below. ```kotlin class FirebaseFooRegistrar : ComponentRegistrar { @@ -204,6 +189,7 @@ class FirebaseFooRegistrar : ComponentRegistrar {
For Java +
src/main/java/com/google/firebase/foo/FirebaseFooRegistrar.java diff --git a/docs/README.md b/docs/README.md index a10571797d3..dfedd7abcf4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,38 +1,37 @@ # Firebase Android SDK -The Firebase SDK for Android is the official way to add Firebase to your -Android app. To get started, visit the [setup instructions][android-setup]. +The Firebase SDK for Android is the official way to add Firebase to your Android app. To get +started, visit the [setup instructions][android-setup]. ## Open Source This repository includes the following Firebase SDKs for Android: - * `firebase-common` - * `firebase-database` - * `firebase-firestore` - * `firebase-functions` - * `firebase-inappmessaging-display` - * `firebase-perf` - * `firebase-storage` +- `firebase-common` +- `firebase-database` +- `firebase-firestore` +- `firebase-functions` +- `firebase-inappmessaging-display` +- `firebase-perf` +- `firebase-storage` -For more information on building the SDKs from source or contributing, -visit the [main README][main-readme]. +For more information on building the SDKs from source or contributing, visit the [main +README][main-readme]. ## Kotlin Extensions -The following Firebase SDKs for Android have Kotlin extension libraries -that allow you to write more idiomatic Kotlin code when using Firebase -in your app: - - * [`firebase-common`](ktx/common.md) - * [`firebase-crashlytics`](ktx/crashlytics.md) - * [`firebase-firestore`](ktx/firestore.md) - * [`firebase-functions`](ktx/functions.md) - * [`firebase-inappmessaging`](ktx/inappmessaging.md) - * [`firebase-inappmessaging-display`](ktx/inappmessaging-display.md) - * [`firebase-remote-config`](ktx/remote-config.md) - * [`firebase-storage`](ktx/storage.md) - * [`firebase-database`](ktx/database.md) +The following Firebase SDKs for Android have Kotlin extension libraries that allow you to write more +idiomatic Kotlin code when using Firebase in your app: + +- [`firebase-common`](ktx/common.md) +- [`firebase-crashlytics`](ktx/crashlytics.md) +- [`firebase-firestore`](ktx/firestore.md) +- [`firebase-functions`](ktx/functions.md) +- [`firebase-inappmessaging`](ktx/inappmessaging.md) +- [`firebase-inappmessaging-display`](ktx/inappmessaging-display.md) +- [`firebase-remote-config`](ktx/remote-config.md) +- [`firebase-storage`](ktx/storage.md) +- [`firebase-database`](ktx/database.md) [android-setup]: https://firebase.google.com/docs/android/setup [main-readme]: https://github.com/firebase/firebase-android-sdk/blob/main/README.md diff --git a/encoders/README.md b/encoders/README.md index 6a33fcb1c81..afc897087d2 100644 --- a/encoders/README.md +++ b/encoders/README.md @@ -1,27 +1,24 @@ # Firebase Encoders -This project provides libraries and code generation infrastructure that allows -encoding java classes into various target serialization formats(currently -supported: **json** and **proto**). +This project provides libraries and code generation infrastructure that allows encoding java classes +into various target serialization formats(currently supported: **json** and **proto**). The project consists of multiple parts: -* `firebase_encoders` - Core API and Annotations library. -* `processor` - Java plugin that automatically generates encoders for - `@Encodable` annotated POJOs. -* `firebase_encoders_json` - JSON serialization support. -* `firebase_encoders_proto` - Protobuf serialization support. -* `protoc_gen` - Protobuf compiler plugin that generates encoder-compliant - classes. Can be used with `firebase_encoders_proto` and - `firebase_encoders_json`. -* `reflective` - Can be used to encode any given class via Java - reflection(**not recommented**). +- `firebase_encoders` - Core API and Annotations library. +- `processor` - Java plugin that automatically generates encoders for `@Encodable` annotated POJOs. +- `firebase_encoders_json` - JSON serialization support. +- `firebase_encoders_proto` - Protobuf serialization support. +- `protoc_gen` - Protobuf compiler plugin that generates encoder-compliant classes. Can be used with + `firebase_encoders_proto` and `firebase_encoders_json`. +- `reflective` - Can be used to encode any given class via Java reflection(**not recommented**). ### Protobuf gettings started ##### Step1. Place proto files into **src/main/proto/** -*src/main/proto/my.proto* +_src/main/proto/my.proto_ + ```proto syntax = "proto3"; @@ -35,10 +32,10 @@ message SimpleProto { } ``` - ##### Step2. Add the following configurations into gradle module build file. -*example.gradle* +_example.gradle_ + ```gradle plugins { id "java-library" @@ -86,11 +83,14 @@ dependencies { ##### Step3. Create a code-gen-cfg.textproto file at the module root folder(same location as the gradle module build file). -*code-gen-cfg.textproto* +_code-gen-cfg.textproto_ Note: + - The filename must be the same as the filename determined in the gradle build file. -- Only need to specify the "root" proto object, anything it references will automatically be included. +- Only need to specify the "root" proto object, anything it references will automatically be + included. + ```textproto # code_gen_cfg.textproto # proto-file: src/main/proto/my.proto @@ -112,8 +112,7 @@ com.google.google.protobuf.Timestamp com.google.google.protobuf.Timestamp$Builder ``` -Only `root` classes are "encodable" meaning that they have the following -methods: +Only `root` classes are "encodable" meaning that they have the following methods: ```java public class SimpleProto { @@ -124,7 +123,8 @@ public class SimpleProto { ### Annotation Processing on Kotlin -The default gradle `annotationProcessor` import doesn't run the processor over kotlin code, so we need to use `kapt` +The default gradle `annotationProcessor` import doesn't run the processor over kotlin code, so we +need to use `kapt` 1. Add the plugin to your build @@ -145,4 +145,4 @@ dependencies { // annotationProcessor project(":encoders:firebase-encoders-processor") kapt project(":encoders:firebase-encoders-processor") } -``` \ No newline at end of file +``` diff --git a/encoders/firebase-decoders-json/CHANGELOG.md b/encoders/firebase-decoders-json/CHANGELOG.md index f514bbb890e..79e701b844d 100644 --- a/encoders/firebase-decoders-json/CHANGELOG.md +++ b/encoders/firebase-decoders-json/CHANGELOG.md @@ -1,3 +1 @@ # Unreleased - - diff --git a/encoders/firebase-encoders-json/CHANGELOG.md b/encoders/firebase-encoders-json/CHANGELOG.md index f514bbb890e..79e701b844d 100644 --- a/encoders/firebase-encoders-json/CHANGELOG.md +++ b/encoders/firebase-encoders-json/CHANGELOG.md @@ -1,3 +1 @@ # Unreleased - - diff --git a/encoders/firebase-encoders-processor/CHANGELOG.md b/encoders/firebase-encoders-processor/CHANGELOG.md index f514bbb890e..79e701b844d 100644 --- a/encoders/firebase-encoders-processor/CHANGELOG.md +++ b/encoders/firebase-encoders-processor/CHANGELOG.md @@ -1,3 +1 @@ # Unreleased - - diff --git a/encoders/firebase-encoders-proto/CHANGELOG.md b/encoders/firebase-encoders-proto/CHANGELOG.md index f4e346bb920..d43e9b27315 100644 --- a/encoders/firebase-encoders-proto/CHANGELOG.md +++ b/encoders/firebase-encoders-proto/CHANGELOG.md @@ -1,4 +1,4 @@ # Unreleased -* [changed] Updated protobuf dependency to `3.25.5` to fix - [CVE-2024-7254](https://nvd.nist.gov/vuln/detail/CVE-2024-7254). +- [changed] Updated protobuf dependency to `3.25.5` to fix + [CVE-2024-7254](https://nvd.nist.gov/vuln/detail/CVE-2024-7254). diff --git a/encoders/firebase-encoders-reflective/CHANGELOG.md b/encoders/firebase-encoders-reflective/CHANGELOG.md index f514bbb890e..79e701b844d 100644 --- a/encoders/firebase-encoders-reflective/CHANGELOG.md +++ b/encoders/firebase-encoders-reflective/CHANGELOG.md @@ -1,3 +1 @@ # Unreleased - - diff --git a/encoders/firebase-encoders/CHANGELOG.md b/encoders/firebase-encoders/CHANGELOG.md index f514bbb890e..79e701b844d 100644 --- a/encoders/firebase-encoders/CHANGELOG.md +++ b/encoders/firebase-encoders/CHANGELOG.md @@ -1,3 +1 @@ # Unreleased - - diff --git a/encoders/protoc-gen-firebase-encoders/CHANGELOG.md b/encoders/protoc-gen-firebase-encoders/CHANGELOG.md index f514bbb890e..79e701b844d 100644 --- a/encoders/protoc-gen-firebase-encoders/CHANGELOG.md +++ b/encoders/protoc-gen-firebase-encoders/CHANGELOG.md @@ -1,3 +1 @@ # Unreleased - - diff --git a/firebase-abt/CHANGELOG.md b/firebase-abt/CHANGELOG.md index 6963fe572a4..bb9053ea820 100644 --- a/firebase-abt/CHANGELOG.md +++ b/firebase-abt/CHANGELOG.md @@ -1,54 +1,60 @@ # Unreleased - # 23.0.0 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. -* [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions - (KTX) module and removed it from the Firebase Android BoM. Instead, use the KTX APIs - from the main module. For details, see the + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. +- [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions (KTX) module and + removed it from the Firebase Android BoM. Instead, use the KTX APIs from the main module. For + details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration). # 22.0.0 -* [changed] Bump internal dependencies + +- [changed] Bump internal dependencies # 21.1.2 -* [changed] Bump internal dependencies. + +- [changed] Bump internal dependencies. # 21.1.1 -* [changed] Internal changes to improve experiment reporting. + +- [changed] Internal changes to improve experiment reporting. # 21.1.0 -* [changed] Internal changes to ensure functionality alignment with other - SDK releases. + +- [changed] Internal changes to ensure functionality alignment with other SDK releases. # 21.0.2 -* [changed] Updated dependency of `play-services-basement` to its latest - version (v18.1.0). + +- [changed] Updated dependency of `play-services-basement` to its latest version (v18.1.0). # 21.0.1 -* [changed] Updated dependencies of `play-services-basement`, - `play-services-base`, and `play-services-tasks` to their latest versions - (v18.0.0, v18.0.1, and v18.0.1, respectively). For more information, see the - [note](#basement18-0-0_base18-0-1_tasks18-0-1) at the top of this release - entry. + +- [changed] Updated dependencies of `play-services-basement`, `play-services-base`, and + `play-services-tasks` to their latest versions (v18.0.0, v18.0.1, and v18.0.1, respectively). For + more information, see the [note](#basement18-0-0_base18-0-1_tasks18-0-1) at the top of this + release entry. # 21.0.0 -* [changed] Internal infrastructure improvements. -* [changed] Internal changes to support dynamic feature modules. + +- [changed] Internal infrastructure improvements. +- [changed] Internal changes to support dynamic feature modules. # 20.0.0 -* [removed] Removed the protocol buffer dependency and moved relevant protocol - buffer definitions to [inappmessaging_longer]. If you use [ab_testing] - with [inappmessaging], you'll need to update to + +- [removed] Removed the protocol buffer dependency and moved relevant protocol buffer definitions to + [inappmessaging_longer]. If you use [ab_testing] with [inappmessaging], you'll need to update to [inappmessaging] v19.1.2 or later. # 19.0.1 -* [changed] Internal changes to ensure functionality alignment with other SDK releases. + +- [changed] Internal changes to ensure functionality alignment with other SDK releases. # 17.1.1 -* [changed] Updated API to support the latest [remote_config] update. -* [changed] Updated minSdkVersion to API level 16. + +- [changed] Updated API to support the latest [remote_config] update. +- [changed] Updated minSdkVersion to API level 16. # 17.1.0 -* [changed] Updated API to support the latest [remote_config] update. +- [changed] Updated API to support the latest [remote_config] update. diff --git a/firebase-ai/CHANGELOG.md b/firebase-ai/CHANGELOG.md index 1d85bf47c86..471ca4071a4 100644 --- a/firebase-ai/CHANGELOG.md +++ b/firebase-ai/CHANGELOG.md @@ -1,62 +1,74 @@ # Unreleased -* [feature] Added support for returning thought summaries, which are synthesized - versions of a model's internal reasoning process. -* [fixed] Fixed an issue causing the accessor methods in `GenerateContentResponse` to throw an exception - when the response contained no candidates. -* [changed] Added better description for requests which fail due to the Gemini API not being + +- [feature] Added support for returning thought summaries, which are synthesized versions of a + model's internal reasoning process. +- [fixed] Fixed an issue causing the accessor methods in `GenerateContentResponse` to throw an + exception when the response contained no candidates. +- [changed] Added better description for requests which fail due to the Gemini API not being configured. -* [changed] Added a `dilation` parameter to `ImagenMaskReference.generateMaskAndPadForOutpainting` +- [changed] Added a `dilation` parameter to `ImagenMaskReference.generateMaskAndPadForOutpainting` (#7260) -* [feature] Added support for limited-use tokens with Firebase App Check. These short-lived tokens +- [feature] Added support for limited-use tokens with Firebase App Check. These short-lived tokens provide greater protection for the APIs that give you access to Gemini and Imagen models. Learn how to [enable usage of limited-use tokens](https://firebase.google.com/docs/ai-logic/app-check). (#7285) - # 17.1.0 + ======= -* [feature] added support for Imagen Editing, including inpainting, outpainting, control, style + +- [feature] added support for Imagen Editing, including inpainting, outpainting, control, style transfer, and subject references (#7075) -* [feature] **Preview:** Added support for bidirectional streaming in Gemini Developer Api +- [feature] **Preview:** Added support for bidirectional streaming in Gemini Developer Api # 17.0.0 -* [feature] Added support for configuring the "thinking" budget when using Gemini - 2.5 series models. (#6990) -* [feature] **Breaking Change**: Add support for Grounding with Google Search (#7042). - * **Action Required:** Update all references of `groundingAttributions`, `webSearchQueries`, `retrievalQueries` in `GroundingMetadata` to be non-optional. -* [changed] require at least one argument for `generateContent()`, `generateContentStream()` and + +- [feature] Added support for configuring the "thinking" budget when using Gemini 2.5 series models. + (#6990) +- [feature] **Breaking Change**: Add support for Grounding with Google Search (#7042). + - **Action Required:** Update all references of `groundingAttributions`, `webSearchQueries`, + `retrievalQueries` in `GroundingMetadata` to be non-optional. +- [changed] require at least one argument for `generateContent()`, `generateContentStream()` and `countTokens()`. -* [feature] Added new overloads for `generateContent()`, `generateContentStream()` and - `countTokens()` that take a `List` parameter. -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. +- [feature] Added new overloads for `generateContent()`, `generateContentStream()` and + `countTokens()` that take a `List` parameter. +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. # 16.2.0 -* [changed] Deprecate the `totalBillableCharacters` field (only usable with pre-2.0 models). (#7042) -* [feature] Added support for extra schema properties like `title`, `minItems`, `maxItems`, `minimum` - and `maximum`. As well as support for the `anyOf` schema. (#7013) + +- [changed] Deprecate the `totalBillableCharacters` field (only usable with pre-2.0 models). (#7042) +- [feature] Added support for extra schema properties like `title`, `minItems`, `maxItems`, + `minimum` and `maximum`. As well as support for the `anyOf` schema. (#7013) # 16.1.0 -* [fixed] Fixed `FirebaseAI.getInstance` StackOverflowException (#6971) -* [fixed] Fixed an issue that was causing the SDK to send empty `FunctionDeclaration` descriptions to the API. -* [changed] Introduced the `Voice` class, which accepts a voice name, and deprecated the `Voices` class. -* [changed] **Breaking Change**: Updated `SpeechConfig` to take in `Voice` class instead of `Voices` class. - * **Action Required:** Update all references of `SpeechConfig` initialization to use `Voice` class. -* [fixed] Fix incorrect model name in count token requests to the developer API backend + +- [fixed] Fixed `FirebaseAI.getInstance` StackOverflowException (#6971) +- [fixed] Fixed an issue that was causing the SDK to send empty `FunctionDeclaration` descriptions + to the API. +- [changed] Introduced the `Voice` class, which accepts a voice name, and deprecated the `Voices` + class. +- [changed] **Breaking Change**: Updated `SpeechConfig` to take in `Voice` class instead of `Voices` + class. + - **Action Required:** Update all references of `SpeechConfig` initialization to use `Voice` + class. +- [fixed] Fix incorrect model name in count token requests to the developer API backend # 16.0.0 -* [feature] Initial release of the Firebase AI SDK (`firebase-ai`). This SDK *replaces* the previous - Vertex AI in Firebase SDK (`firebase-vertexai`) to accommodate the evolving set of supported - features and services. - * The new Firebase AI SDK provides **Preview** support for the Gemini Developer API, including its - free tier offering. - * Using the Firebase AI SDK with the Vertex AI Gemini API is still generally available (GA). - - If you're using the old `firebase-vertexai`, we recommend - [migrating to `firebase-ai`](/docs/ai-logic/migrate-to-latest-sdk) - because all new development and features will be in this new SDK. -* [feature] **Preview:** Added support for specifying response modalities in `GenerationConfig` - (only available in the new `firebase-ai` package). This includes support for image generation using - [specific Gemini models](/docs/vertex-ai/models). - - Note: This feature is in Public Preview, which means that it is not subject to any SLA or - deprecation policy and could change in backwards-incompatible ways. + +- [feature] Initial release of the Firebase AI SDK (`firebase-ai`). This SDK _replaces_ the previous + Vertex AI in Firebase SDK (`firebase-vertexai`) to accommodate the evolving set of supported + features and services. + - The new Firebase AI SDK provides **Preview** support for the Gemini Developer API, including its + free tier offering. + - Using the Firebase AI SDK with the Vertex AI Gemini API is still generally available (GA). + +If you're using the old `firebase-vertexai`, we recommend +[migrating to `firebase-ai`](/docs/ai-logic/migrate-to-latest-sdk) because all new development and +features will be in this new SDK. + +- [feature] **Preview:** Added support for specifying response modalities in `GenerationConfig` + (only available in the new `firebase-ai` package). This includes support for image generation + using [specific Gemini models](/docs/vertex-ai/models). + +Note: This feature is in Public Preview, which means that it is not subject to any SLA or +deprecation policy and could change in backwards-incompatible ways. diff --git a/firebase-ai/README.md b/firebase-ai/README.md index e09f65c6092..2572fd8da18 100644 --- a/firebase-ai/README.md +++ b/firebase-ai/README.md @@ -1,7 +1,7 @@ # Firebase AI SDK -For developer documentation, please visit https://firebase.google.com/docs/vertex-ai. -This README is for contributors building and running tests for the SDK. +For developer documentation, please visit https://firebase.google.com/docs/vertex-ai. This README is +for contributors building and running tests for the SDK. ## Building @@ -11,9 +11,8 @@ All Gradle commands should be run from the root of this repository. ## Running Tests -> [!IMPORTANT] -> These unit tests require mock response files, which can be downloaded by running -`./firebase-ai/update_responses.sh` from the root of this repository. +> [!IMPORTANT] These unit tests require mock response files, which can be downloaded by running +> `./firebase-ai/update_responses.sh` from the root of this repository. Unit tests: @@ -25,8 +24,8 @@ Integration tests, requiring a running and connected device (emulator or real): ## Code Formatting -Format Kotlin code in this SDK in Android Studio using -the [spotless plugin]([https://plugins.jetbrains.com/plugin/14912-ktfmt](https://github.com/diffplug/spotless) -by running: +Format Kotlin code in this SDK in Android Studio using the [spotless +plugin]([https://plugins.jetbrains.com/plugin/14912-ktfmt](https://github.com/diffplug/spotless) by +running: `./gradlew firebase-ai:spotlessApply` diff --git a/firebase-ai/src/test/resources/README.md b/firebase-ai/src/test/resources/README.md index 372846e739d..682548dd6ba 100644 --- a/firebase-ai/src/test/resources/README.md +++ b/firebase-ai/src/test/resources/README.md @@ -1,2 +1,2 @@ -Mock response files should be cloned into this directory to run unit tests. See -the Firebase AI [README](../../..#running-tests) for instructions. \ No newline at end of file +Mock response files should be cloned into this directory to run unit tests. See the Firebase AI +[README](../../..#running-tests) for instructions. diff --git a/firebase-annotations/CHANGELOG.md b/firebase-annotations/CHANGELOG.md index 5b97d49e713..b716a3fd418 100644 --- a/firebase-annotations/CHANGELOG.md +++ b/firebase-annotations/CHANGELOG.md @@ -1,3 +1,3 @@ # Unreleased -* [changed] Hid Executors from public API, as they are intended to be internal - anyhow. + +- [changed] Hid Executors from public API, as they are intended to be internal anyhow. diff --git a/firebase-appdistribution-api/CHANGELOG.md b/firebase-appdistribution-api/CHANGELOG.md index cd878864e41..2f7fc9b9fa1 100644 --- a/firebase-appdistribution-api/CHANGELOG.md +++ b/firebase-appdistribution-api/CHANGELOG.md @@ -1,167 +1,153 @@ # Unreleased - # 16.0.0-beta16 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. -* [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions - (KTX) module and removed it from the Firebase Android BoM. Instead, use the KTX APIs - from the main module. For details, see the + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. +- [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions (KTX) module and + removed it from the Firebase Android BoM. Instead, use the KTX APIs from the main module. For + details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration). # 16.0.0-beta15 -* [unchanged] Updated to accommodate the release of the updated - [appdistro] library. +- [unchanged] Updated to accommodate the release of the updated [appdistro] library. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta14 -* [unchanged] Updated to accommodate the release of the updated - [appdistro] library. +- [unchanged] Updated to accommodate the release of the updated [appdistro] library. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta13 -* [changed] Bump internal dependencies +- [changed] Bump internal dependencies ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta12 -* [unchanged] Updated to accommodate the release of the updated - [appdistro] library. +- [unchanged] Updated to accommodate the release of the updated [appdistro] library. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta11 -* [changed] Added Kotlin extensions (KTX) APIs from - `com.google.firebase:firebase-appdistribution-api-ktx` - to `com.google.firebase:firebase-appdistribution-api` under the - `com.google.firebase.appdistribution` package. - For details, see the + +- [changed] Added Kotlin extensions (KTX) APIs from + `com.google.firebase:firebase-appdistribution-api-ktx` to + `com.google.firebase:firebase-appdistribution-api` under the `com.google.firebase.appdistribution` + package. For details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) -* [deprecated] All the APIs from `com.google.firebase:firebase-appdistribution-api-ktx` have been - added to - `com.google.firebase:firebase-appdistribution-api` under the - `com.google.firebase.appdistribution` package, - and all the Kotlin extensions (KTX) APIs in `com.google.firebase:firebase-appdistribution-api-ktx` - are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, - see the +- [deprecated] All the APIs from `com.google.firebase:firebase-appdistribution-api-ktx` have been + added to `com.google.firebase:firebase-appdistribution-api` under the + `com.google.firebase.appdistribution` package, and all the Kotlin extensions (KTX) APIs in + `com.google.firebase:firebase-appdistribution-api-ktx` are now deprecated. As early as April 2024, + we'll no longer release KTX modules. For details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta09 -* [feature] Improved development mode to allow all API calls to be made without having to sign in. +- [feature] Improved development mode to allow all API calls to be made without having to sign in. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no -additional updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta08 -* [fixed] Fixed an issue where a crash happened whenever a feedback - notification was shown on devices running Android 4.4 and lower. +- [fixed] Fixed an issue where a crash happened whenever a feedback notification was shown on + devices running Android 4.4 and lower. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no -additional updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta07 -* [feature] Added support for testers to attach JPEG screenshots to their - feedback. +- [feature] Added support for testers to attach JPEG screenshots to their feedback. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no -additional updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta06 -* [feature] Added support for in-app tester feedback. To learn more, see - [Collect feedback from testers](/docs/app-distribution/collect-feedback-from-testers?platform=android). -* [fixed] Fixed a bug where only the last listener added to an `UpdateTask` - using `addOnProgressListener()` would receive updates. +- [feature] Added support for in-app tester feedback. To learn more, see + [Collect feedback from testers](/docs/app-distribution/collect-feedback-from-testers?platform=android). +- [fixed] Fixed a bug where only the last listener added to an `UpdateTask` using + `addOnProgressListener()` would receive updates. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta05 -* [unchanged] Updated to accommodate the release of the updated - [appdistro] Kotlin extensions library. +- [unchanged] Updated to accommodate the release of the updated [appdistro] Kotlin extensions + library. ## Kotlin -The Kotlin extensions library transitively includes the updated - `firebase-appdistribution-api` library. The Kotlin extensions library has - the following additional updates: - -* [feature] Firebase now supports Kotlin coroutines. - With this release, we added - [`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: .external} - to `firebase-appdistribution-api-ktx` as a transitive dependency, which - exposes the `Task.await()` suspend function to convert a - [`Task`](https://developers.google.com/android/guides/tasks) - into a Kotlin coroutine. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has the following additional updates: + +- [feature] Firebase now supports Kotlin coroutines. With this release, we added + [`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: + .external} to `firebase-appdistribution-api-ktx` as a transitive dependency, which exposes the + `Task.await()` suspend function to convert a + [`Task`](https://developers.google.com/android/guides/tasks) into a Kotlin coroutine. # 16.0.0-beta04 -* [changed] Updated dependency of `play-services-basement` to its latest - version (v18.1.0). +- [changed] Updated dependency of `play-services-basement` to its latest version (v18.1.0). ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-appdistribution-api` library. The Kotlin extensions library has no -additional updates. + +The Kotlin extensions library transitively includes the updated `firebase-appdistribution-api` +library. The Kotlin extensions library has no additional updates. # 16.0.0-beta03 -* [feature] The [appdistro] SDK has been split into two libraries: - * `firebase-appdistribution-api` - The API-only library
- This new API-only library is functional only when the full - [appdistro] SDK implementation (`firebase-appdistribution`) is present. - `firebase-appdistribution-api` can be included in all +- [feature] The [appdistro] SDK has been split into two libraries: + + - `firebase-appdistribution-api` - The API-only library
This new API-only library is + functional only when the full [appdistro] SDK implementation (`firebase-appdistribution`) is + present. `firebase-appdistribution-api` can be included in all [build variants](https://developer.android.com/studio/build/build-variants){: .external}. - * `firebase-appdistribution` - The full SDK implementation
- This full SDK implementation is optional and should only be included in - pre-release builds. + - `firebase-appdistribution` - The full SDK implementation
This full SDK implementation is + optional and should only be included in pre-release builds. Visit the documentation to learn how to - [add these SDKs](/docs/app-distribution/set-up-alerts?platform=android#add-appdistro) - to your Android app. - + [add these SDKs](/docs/app-distribution/set-up-alerts?platform=android#add-appdistro) to your + Android app. ## Kotlin -With the removal of the Kotlin extensions library -`firebase-appdistribution-ktx`, its functionality has been moved to the new -API-only library: `firebase-appdistribution-api-ktx`. -This new Kotlin extensions library transitively includes the -`firebase-appdistribution-api` library. The Kotlin extensions library has no -additional updates. +With the removal of the Kotlin extensions library `firebase-appdistribution-ktx`, its functionality +has been moved to the new API-only library: `firebase-appdistribution-api-ktx`. +This new Kotlin extensions library transitively includes the `firebase-appdistribution-api` library. +The Kotlin extensions library has no additional updates. diff --git a/firebase-appdistribution/CHANGELOG.md b/firebase-appdistribution/CHANGELOG.md index 6d1d5e6a9aa..c1936b67678 100644 --- a/firebase-appdistribution/CHANGELOG.md +++ b/firebase-appdistribution/CHANGELOG.md @@ -1,91 +1,96 @@ # Unreleased - # 16.0.0-beta16 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. # 16.0.0-beta15 -* [fixed] Added custom tab support for more browsers [#6692] + +- [fixed] Added custom tab support for more browsers [#6692] # 16.0.0-beta14 -* [changed] Internal improvements to testing on Android 14 + +- [changed] Internal improvements to testing on Android 14 # 16.0.0-beta13 -* [changed] Bump internal dependencies + +- [changed] Bump internal dependencies # 16.0.0-beta12 -* [changed] Bump internal dependencies. + +- [changed] Bump internal dependencies. # 16.0.0-beta10 -* [fixed] Updated the third-party license file to include Dagger's license. + +- [fixed] Updated the third-party license file to include Dagger's license. # 16.0.0-beta09 -* [feature] Improved development mode to allow all API calls to be made without having to sign in. + +- [feature] Improved development mode to allow all API calls to be made without having to sign in. # 16.0.0-beta08 -* [fixed] Fixed an issue where a crash happened whenever a feedback - notification was shown on devices running Android 4.4 and lower. + +- [fixed] Fixed an issue where a crash happened whenever a feedback notification was shown on + devices running Android 4.4 and lower. # 16.0.0-beta07 -* [feature] Added support for testers to attach JPEG screenshots to their - feedback. + +- [feature] Added support for testers to attach JPEG screenshots to their feedback. # 16.0.0-beta06 -* [feature] Added support for in-app tester feedback. To learn more, see + +- [feature] Added support for in-app tester feedback. To learn more, see [Collect feedback from testers](/docs/app-distribution/collect-feedback-from-testers). -* [fixed] Fixed a bug where only the last listener added to an `UpdateTask` - using `addOnProgressListener()` would receive updates. +- [fixed] Fixed a bug where only the last listener added to an `UpdateTask` using + `addOnProgressListener()` would receive updates. # 16.0.0-beta05 -* [unchanged] Updated to accommodate the release of the updated - [appdistro] Kotlin extensions library. + +- [unchanged] Updated to accommodate the release of the updated [appdistro] Kotlin extensions + library. # 16.0.0-beta03 -* [feature] The [appdistro] SDK has been split into two libraries: - * `firebase-appdistribution-api` - The API-only library
- This new API-only library is functional only when the full - [appdistro] SDK implementation (`firebase-appdistribution`) is present. - `firebase-appdistribution-api` can be included in all +- [feature] The [appdistro] SDK has been split into two libraries: + + - `firebase-appdistribution-api` - The API-only library
This new API-only library is + functional only when the full [appdistro] SDK implementation (`firebase-appdistribution`) is + present. `firebase-appdistribution-api` can be included in all [build variants](https://developer.android.com/studio/build/build-variants){: .external}. - * `firebase-appdistribution` - The full SDK implementation
- This full SDK implementation is optional and should only be included in - pre-release builds. + - `firebase-appdistribution` - The full SDK implementation
This full SDK implementation is + optional and should only be included in pre-release builds. Visit the documentation to learn how to - [add these SDKs](/docs/app-distribution/set-up-alerts?platform=android#add-appdistro) - to your Android app. - + [add these SDKs](/docs/app-distribution/set-up-alerts?platform=android#add-appdistro) to your + Android app. ## Kotlin -* [removed] The Kotlin extensions library `firebase-appdistribution-ktx` - has been removed. All its functionality has been moved to the new API-only - library: `firebase-appdistribution-api-ktx`. + +- [removed] The Kotlin extensions library `firebase-appdistribution-ktx` has been removed. All its + functionality has been moved to the new API-only library: `firebase-appdistribution-api-ktx`. # 16.0.0-beta02 -* [fixed] Fixed a bug that prevented testers from signing in when the app had -an underscore in the package name. -* [fixed] Fixed a UI bug where the APK download notification displayed the -incorrect error message. -* [changed] Internal improvements to tests. +- [fixed] Fixed a bug that prevented testers from signing in when the app had an underscore in the + package name. +- [fixed] Fixed a UI bug where the APK download notification displayed the incorrect error message. +- [changed] Internal improvements to tests. ## Kotlin -The Kotlin extensions library transitively includes the base -`firebase-app-distribution` library. The Kotlin extensions library has no -additional updates. + +The Kotlin extensions library transitively includes the base `firebase-app-distribution` library. +The Kotlin extensions library has no additional updates. # 16.0.0-beta01 -* [feature] The [appdistro] Android SDK is now available in beta. You - can use this SDK to notify testers in-app when a new test build is available. - To learn more, visit the - [[appdistro] reference documentation](/docs/reference/android/com/google/firebase/appdistribution/package-summary). +- [feature] The [appdistro] Android SDK is now available in beta. You can use this SDK to notify + testers in-app when a new test build is available. To learn more, visit the + [[appdistro] reference documentation](/docs/reference/android/com/google/firebase/appdistribution/package-summary). ## Kotlin -The [appdistro] Android library with Kotlin extensions is now available in -beta. The Kotlin extensions library transitively includes the base -`firebase-app-distribution` library. To learn more, visit the -[[appdistro] KTX reference documentation](/docs/reference/kotlin/com/google/firebase/appdistribution/ktx/package-summary). +The [appdistro] Android library with Kotlin extensions is now available in beta. The Kotlin +extensions library transitively includes the base `firebase-app-distribution` library. To learn +more, visit the +[[appdistro] KTX reference documentation](/docs/reference/kotlin/com/google/firebase/appdistribution/ktx/package-summary). diff --git a/firebase-appdistribution/test-app/README.md b/firebase-appdistribution/test-app/README.md index 2d630d40e0e..179296e4d64 100644 --- a/firebase-appdistribution/test-app/README.md +++ b/firebase-appdistribution/test-app/README.md @@ -2,26 +2,33 @@ ## Setup -Download the `google-services.json` file from [Firebase Console](https://console.firebase.google.com/) -(for whatever Firebase project you have or want to integrate the `dev-app`) and store it under the -current directory. +Download the `google-services.json` file from +[Firebase Console](https://console.firebase.google.com/) (for whatever Firebase project you have or +want to integrate the `dev-app`) and store it under the current directory.

> **Note:** The [Package name](https://firebase.google.com/docs/android/setup#register-app) for your -app created on the Firebase Console (for which the `google-services.json` is downloaded) must match -the [applicationId](https://developer.android.com/studio/build/application-id.html) declared in the -`test-app/test-app.gradle` for the app to link to Firebase. +> app created on the Firebase Console (for which the `google-services.json` is downloaded) must +> match the [applicationId](https://developer.android.com/studio/build/application-id.html) declared +> in the `test-app/test-app.gradle` for the app to link to Firebase. ## Build & Install -### Enable the test-app as a subproject ### +### Enable the test-app as a subproject -You'll need to do this on a fresh checkout, otherwise you will see the error `Project 'test-app' not found in project ':firebase-appdistribution'.` when running `./gradlew` tasks for the test app. +You'll need to do this on a fresh checkout, otherwise you will see the error +`Project 'test-app' not found in project ':firebase-appdistribution'.` when running `./gradlew` +tasks for the test app. -By default, product-specific subprojects are disabled in the SDK because their `google-services.json` files aren't always available in CI and therefore they can't be reliably built. To do local development with this test app, it needs to be manually enabled by uncommenting it out at the bottom of [subprojects.cfg](https://github.com/firebase/firebase-android-sdk/blob/main/subprojects.cfg) (*Don't check this in*) +By default, product-specific subprojects are disabled in the SDK because their +`google-services.json` files aren't always available in CI and therefore they can't be reliably +built. To do local development with this test app, it needs to be manually enabled by uncommenting +it out at the bottom of +[subprojects.cfg](https://github.com/firebase/firebase-android-sdk/blob/main/subprojects.cfg) +(_Don't check this in_) ``` # @@ -42,8 +49,9 @@ firebase-appdistribution:test-app firebase-android-sdk$ ./gradlew :clean :firebase-appdistribution:test-app:build ``` -After the build is successful, [bring up emulator/physical device](https://developer.android.com/studio/run/emulator) -and install the apk: +After the build is successful, +[bring up emulator/physical device](https://developer.android.com/studio/run/emulator) and install +the apk: ``` firebase-android-sdk$ adb install firebase-appdistribution/test-app/build/outputs/apk/release/test-app-release.apk @@ -51,26 +59,32 @@ firebase-android-sdk$ adb install firebase-appdistribution/test-app/build/output ## Test In-App Feedback Locally -In-App Feedback is currently tricky to test locally because it relies on the -fact that a release exists with the same hash of the running binary. +In-App Feedback is currently tricky to test locally because it relies on the fact that a release +exists with the same hash of the running binary. To build the debug APK, upload it to App Distribution, and install it on the running emulator: -1. In firebase-appdistribution/test-app/test-app.gradle, uncomment the line `// testers "your email here"` and replace "your email here" with the email you intend to use for testing. + +1. In firebase-appdistribution/test-app/test-app.gradle, uncomment the line + `// testers "your email here"` and replace "your email here" with the email you intend to use for + testing. 1. Start an emulator 1. Run the following command from the repo's root directory: - ``` - ./gradlew clean :firebase-appdistribution:test-app:build :firebase-appdistribution:test-app:appDistributionUploadBetaDebug && adb install firebase-appdistribution/test-app/build/outputs/apk/beta/debug/test-app-beta-debug.apk - ``` - -This will build the debug variant of the app (which has the full SDK), upload it to App Distribution, and install it on the running emulator. Run the app in the emulator to test. As an alternative you can always download it using App Distribution, but using `adb` is just faster. + ``` + ./gradlew clean :firebase-appdistribution:test-app:build :firebase-appdistribution:test-app:appDistributionUploadBetaDebug && adb install firebase-appdistribution/test-app/build/outputs/apk/beta/debug/test-app-beta-debug.apk + ``` + +This will build the debug variant of the app (which has the full SDK), upload it to App +Distribution, and install it on the running emulator. Run the app in the emulator to test. As an +alternative you can always download it using App Distribution, but using `adb` is just faster. After that, if you want to avoid having to do this every time you want to test locally: 1. Submit feedback in the locally running app, to generate some logs -1. In the Logcat output, find the release name (i.e. `"projects/1095562444941/installations/fCmpB677QTybkwfKbViGI-/releases/3prs96fui9kb0"`) +1. In the Logcat output, find the release name (i.e. + `"projects/1095562444941/installations/fCmpB677QTybkwfKbViGI-/releases/3prs96fui9kb0"`) 1. Modify the body of `ReleaseIdentifier.identifyRelease()` to be: - ``` - return Tasks.forResult(""); - ``` + ``` + return Tasks.forResult(""); + ``` diff --git a/firebase-common/CHANGELOG.md b/firebase-common/CHANGELOG.md index 6650be1695a..e293f80284d 100644 --- a/firebase-common/CHANGELOG.md +++ b/firebase-common/CHANGELOG.md @@ -1,35 +1,39 @@ # Unreleased # 22.0.0 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. -* [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions - (KTX) module and removed it from the Firebase Android BoM. Instead, use the KTX APIs - from the main module. For details, see the + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. +- [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions (KTX) module and + removed it from the Firebase Android BoM. Instead, use the KTX APIs from the main module. For + details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration). # 21.0.0 -* [fixed] Correctly declare dependency on firebase-components, issue #5732 -* [changed] Added extension method `Random.nextAlphanumericString()` (PR #5818) -* [changed] Migrated internal `SharedPreferences` usages to `DataStore`. ([GitHub PR #6801](https://github.com/firebase/firebase-android-sdk/pull/6801){ .external}) + +- [fixed] Correctly declare dependency on firebase-components, issue #5732 +- [changed] Added extension method `Random.nextAlphanumericString()` (PR #5818) +- [changed] Migrated internal `SharedPreferences` usages to `DataStore`. + ([GitHub PR #6801](https://github.com/firebase/firebase-android-sdk/pull/6801){ .external}) # 20.4.0 -* [changed] Added Kotlin extensions (KTX) APIs from `com.google.firebase:firebase-common-ktx` -to `com.google.firebase:firebase-common` under the `com.google.firebase` package. -For details, see the -[FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) + +- [changed] Added Kotlin extensions (KTX) APIs from `com.google.firebase:firebase-common-ktx` to + `com.google.firebase:firebase-common` under the `com.google.firebase` package. For details, see + the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) ## Kotlin -* [deprecated] All the APIs from `com.google.firebase:firebase-common-ktx` have been added to -`com.google.firebase:firebase-common` under the `com.google.firebase package`, and all the -Kotlin extensions (KTX) APIs in `com.google.firebase:firebase-common-ktx` are now deprecated. -As early as April 2024, we'll no longer release KTX modules. For details, see the -FAQ about this initiative. -[FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) + +- [deprecated] All the APIs from `com.google.firebase:firebase-common-ktx` have been added to + `com.google.firebase:firebase-common` under the `com.google.firebase package`, and all the Kotlin + extensions (KTX) APIs in `com.google.firebase:firebase-common-ktx` are now deprecated. As early as + April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative. + [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) # 20.3.3 -* [fixed] Addressed issue with C++ being absent in user agent. + +- [fixed] Addressed issue with C++ being absent in user agent. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-common` library. The Kotlin extensions library has no additional -updates + +The Kotlin extensions library transitively includes the updated `firebase-common` library. The +Kotlin extensions library has no additional updates diff --git a/firebase-common/README.md b/firebase-common/README.md index 63ae423d0cd..3b3cea4b37a 100644 --- a/firebase-common/README.md +++ b/firebase-common/README.md @@ -1,11 +1,12 @@ # Firebase Common -firebase-common contains the FirebaseApp, which is used to configure -the firebase sdks as well as the infrastructure that firebase sdks use -to discover and interact with other firebase sdks. + +firebase-common contains the FirebaseApp, which is used to configure the firebase sdks as well as +the infrastructure that firebase sdks use to discover and interact with other firebase sdks. ## Running tests. Unit tests can be run by + ``` $ ./gradlew :firebase-common:check ``` diff --git a/firebase-components/CHANGELOG.md b/firebase-components/CHANGELOG.md index 1625e338b40..73f17b8e426 100644 --- a/firebase-components/CHANGELOG.md +++ b/firebase-components/CHANGELOG.md @@ -1,19 +1,20 @@ # Unreleased # 19.0.0 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. # 18.0.1 -* [fixed] updated proguard rules to keep component registrar working with newer proguard versions. +- [fixed] updated proguard rules to keep component registrar working with newer proguard versions. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-components` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-components` library. The +Kotlin extensions library has no additional updates. # 17.1.2 -* [changed] Internal changes to ensure only one interface is provided for + +- [changed] Internal changes to ensure only one interface is provided for kotlinx.coroutines.CoroutineDispatcher interfaces when both firebase-common and firebase-common-ktx provide them. diff --git a/firebase-components/firebase-dynamic-module-support/CHANGELOG.md b/firebase-components/firebase-dynamic-module-support/CHANGELOG.md index a7c21189679..e18540f051a 100644 --- a/firebase-components/firebase-dynamic-module-support/CHANGELOG.md +++ b/firebase-components/firebase-dynamic-module-support/CHANGELOG.md @@ -1,7 +1,9 @@ # Unreleased # 16.0.0-beta04 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. # 16.0.0-beta03 -* [changed] Updated dependency of play-services-basement to its latest version (v18.1.0). + +- [changed] Updated dependency of play-services-basement to its latest version (v18.1.0). diff --git a/firebase-config-interop/CHANGELOG.md b/firebase-config-interop/CHANGELOG.md index 225bbc02245..54976cbf39d 100644 --- a/firebase-config-interop/CHANGELOG.md +++ b/firebase-config-interop/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased -* [unchanged] Updated to keep [config] SDK versions aligned. + +- [unchanged] Updated to keep [config] SDK versions aligned. # 16.0.0 -* [feature] Initial release. + +- [feature] Initial release. diff --git a/firebase-config/CHANGELOG.md b/firebase-config/CHANGELOG.md index ad818ea2b39..470e2a7da6a 100644 --- a/firebase-config/CHANGELOG.md +++ b/firebase-config/CHANGELOG.md @@ -1,193 +1,193 @@ # Unreleased - # 23.0.0 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. -* [changed] This update introduces improvements to how the SDK handles real-time requests when a + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. +- [changed] This update introduces improvements to how the SDK handles real-time requests when a Firebase project has exceeded its available quota for real-time services. Released in anticipation of future quota enforcement, this change is designed to fetch the latest template even when the quota is exhausted. -* [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions - (KTX) module and removed it from the Firebase Android BoM. Instead, use the KTX APIs - from the main module. For details, see the +- [removed] **Breaking Change**: Stopped releasing the deprecated Kotlin extensions (KTX) module and + removed it from the Firebase Android BoM. Instead, use the KTX APIs from the main module. For + details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration). # 22.1.2 -* [fixed] Fixed `NetworkOnMainThreadException` on Android versions below 8 by disconnecting - `HttpURLConnection` only on API levels 26 and higher. GitHub Issue [#6934] +- [fixed] Fixed `NetworkOnMainThreadException` on Android versions below 8 by disconnecting + `HttpURLConnection` only on API levels 26 and higher. GitHub Issue [#6934] ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 22.1.1 -* [fixed] Fixed an issue where the connection to the real-time Remote Config backend could remain -open in the background. +- [fixed] Fixed an issue where the connection to the real-time Remote Config backend could remain + open in the background. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 22.1.0 -* [feature] Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config. +- [feature] Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API + for setting custom signals and use them to build custom targeting conditions in Remote Config. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 22.0.1 -* [changed] Updated protobuf dependency to `3.25.5` to fix - [CVE-2024-7254](https://nvd.nist.gov/vuln/detail/CVE-2024-7254). +- [changed] Updated protobuf dependency to `3.25.5` to fix + [CVE-2024-7254](https://nvd.nist.gov/vuln/detail/CVE-2024-7254). ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 22.0.0 -* [changed] Bump internal dependencies +- [changed] Bump internal dependencies ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.6.3 -* [fixed] Fixed a bug that could cause a crash if the app was backgrounded - while it was listening for real-time Remote Config updates. For more information, see #5751 + +- [fixed] Fixed a bug that could cause a crash if the app was backgrounded while it was listening + for real-time Remote Config updates. For more information, see #5751 # 21.6.2 -* [fixed] Fixed an issue that could cause [remote_config] personalizations to be logged early in + +- [fixed] Fixed an issue that could cause [remote_config] personalizations to be logged early in specific cases. -* [fixed] Fixed an issue where the connection to the real-time Remote Config backend could remain +- [fixed] Fixed an issue where the connection to the real-time Remote Config backend could remain open in the background. - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.6.1 -* [changed] Bump internal dependencies. +- [changed] Bump internal dependencies. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.6.0 -* [changed] Added support for other Firebase products to integrate with [remote_config]. + +- [changed] Added support for other Firebase products to integrate with [remote_config]. # 21.5.0 -* [changed] Added Kotlin extensions (KTX) APIs from `com.google.firebase:firebase-config-ktx` - to `com.google.firebase:firebase-config` under the `com.google.firebase.remoteconfig` package. - For details, see the + +- [changed] Added Kotlin extensions (KTX) APIs from `com.google.firebase:firebase-config-ktx` to + `com.google.firebase:firebase-config` under the `com.google.firebase.remoteconfig` package. For + details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) -* [deprecated] All the APIs from `com.google.firebase:firebase-config-ktx` have been added to - `com.google.firebase:firebase-config` under the `com.google.firebase.remoteconfig` package, - and all the Kotlin extensions (KTX) APIs in `com.google.firebase:firebase-config-ktx` are - now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the +- [deprecated] All the APIs from `com.google.firebase:firebase-config-ktx` have been added to + `com.google.firebase:firebase-config` under the `com.google.firebase.remoteconfig` package, and + all the Kotlin extensions (KTX) APIs in `com.google.firebase:firebase-config-ktx` are now + deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the [FAQ about this initiative](https://firebase.google.com/docs/android/kotlin-migration) - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.4.1 -* [changed] Internal improvements to support Remote Config real-time updates. +- [changed] Internal improvements to support Remote Config real-time updates. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.4.0 -* [unchanged] Updated to accommodate the release of the updated - [remote_config] Kotlin extensions library. +- [unchanged] Updated to accommodate the release of the updated [remote_config] Kotlin extensions + library. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has the following -additional updates. -* [feature] Added the - [`FirebaseRemoteConfig.configUpdates`](/docs/reference/kotlin/com/google/firebase/remoteconfig/ktx/package-summary#(com.google.firebase.remoteconfig.FirebaseRemoteConfig).configUpdates()) +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has the following additional updates. + +- [feature] Added the + [`FirebaseRemoteConfig.configUpdates`]() Kotlin Flow to listen for real-time config updates. # 21.3.0 -* [feature] Added support for real-time config updates. To learn more, see - [Get started with [firebase_remote_config]](/docs/remote-config/get-started?platform=android#add-real-time-listener). +- [feature] Added support for real-time config updates. To learn more, see + [Get started with [firebase_remote_config]](/docs/remote-config/get-started?platform=android#add-real-time-listener). ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.2.1 -* [changed] Migrated [remote_config] to use standard Firebase executors. +- [changed] Migrated [remote_config] to use standard Firebase executors. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.2.0 -* [unchanged] Updated to accommodate the release of the updated - [remote_config] Kotlin extensions library. +- [unchanged] Updated to accommodate the release of the updated [remote_config] Kotlin extensions + library. ## Kotlin -The Kotlin extensions library transitively includes the updated - `firebase-config` library. The Kotlin extensions library has the following - additional updates: -* [feature] Firebase now supports Kotlin coroutines. - With this release, we added - [`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: .external} - to `firebase-config-ktx` as a transitive dependency, which exposes the +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has the following additional updates: + +- [feature] Firebase now supports Kotlin coroutines. With this release, we added + [`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: + .external} to `firebase-config-ktx` as a transitive dependency, which exposes the `Task.await()` suspend function to convert a - [`Task`](https://developers.google.com/android/guides/tasks) into a Kotlin - coroutine. + [`Task`](https://developers.google.com/android/guides/tasks) into a Kotlin coroutine. # 21.1.2 -* [changed] Updated dependency of `play-services-basement` to its latest - version (v18.1.0). +- [changed] Updated dependency of `play-services-basement` to its latest version (v18.1.0). ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.1.1 -* [fixed] Fixed a bug that caused HTTP errors in some locales. For more - information, see + +- [fixed] Fixed a bug that caused HTTP errors in some locales. For more information, see GitHub Issue #3757 - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.1.0 + -* [changed] Added first-open time to [remote_config] server requests. - +- [changed] Added first-open time to [remote_config] server requests. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.0.2 -* [changed] Updated dependencies of `play-services-basement`, - `play-services-base`, and `play-services-tasks` to their latest versions - (v18.0.0, v18.0.1, and v18.0.1, respectively). For more information, see the - [note](#basement18-0-0_base18-0-1_tasks18-0-1) at the top of this release - entry. +- [changed] Updated dependencies of `play-services-basement`, `play-services-base`, and + `play-services-tasks` to their latest versions (v18.0.0, v18.0.1, and v18.0.1, respectively). For + more information, see the [note](#basement18-0-0_base18-0-1_tasks18-0-1) at the top of this + release entry. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.0.1 -* [fixed] Fixed a bug in the initialization of [remote_config] with a - non-primary Firebase app. +- [fixed] Fixed a bug in the initialization of [remote_config] with a non-primary Firebase app. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 21.0.0 -* [changed] Internal infrastructure improvements. -* [changed] Internal changes to support dynamic feature modules. +- [changed] Internal infrastructure improvements. +- [changed] Internal changes to support dynamic feature modules. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 20.0.4 -* [changed] Improved condition targeting signals. +- [changed] Improved condition targeting signals. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 20.0.3 -* [changed] Standardize support for other Firebase products that integrate - with [remote_config]. +- [changed] Standardize support for other Firebase products that integrate with [remote_config]. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 20.0.2 -* [fixed] Fixed an issue that was causing [remote_config] to return the - static default value even if a remote value was defined. (#2186) +- [fixed] Fixed an issue that was causing [remote_config] to return the static default value even if + a remote value was defined. (#2186) ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 20.0.1 -* [changed] Added support for other Firebase products to integrate with - [remote_config]. +- [changed] Added support for other Firebase products to integrate with [remote_config]. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 20.0.0 -* [removed] Removed the protocol buffer dependency. Also, removed support for - configs saved on device using the legacy protocol buffer format (the SDK - stopped using this legacy format starting with [remote_config] v16.3.0). -* [removed] Removed the deprecated synchronous method - `FirebaseRemoteConfig.activateFetched()`. Use the asynchronous - [`FirebaseRemoteConfig.activate()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#activate()) + +- [removed] Removed the protocol buffer dependency. Also, removed support for configs saved on + device using the legacy protocol buffer format (the SDK stopped using this legacy format starting + with [remote_config] v16.3.0). +- [removed] Removed the deprecated synchronous method `FirebaseRemoteConfig.activateFetched()`. Use + the asynchronous + [`FirebaseRemoteConfig.activate()`]() instead. -* [removed] Removed the deprecated synchronous methods - `FirebaseRemoteConfig.setDefaults(int)` and +- [removed] Removed the deprecated synchronous methods `FirebaseRemoteConfig.setDefaults(int)` and `FirebaseRemoteConfig.setDefaults(Map)`. Use the asynchronous - [`FirebaseRemoteConfig.setDefaultsAsync(int)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(int)) - and [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(Map)) + [`FirebaseRemoteConfig.setDefaultsAsync(int)`]() + and + [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](>) instead. -* [removed] Removed the deprecated synchronous method - `FirebaseRemoteConfig.setConfigSettings(FirebaseRemoteConfigSettings)`. - Use the asynchronous - [`FirebaseRemoteConfig.setConfigSettingsAsync(FirebaseRemoteConfigSettings)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setConfigSettingsAsync(FirebaseRemoteConfigSettings)) +- [removed] Removed the deprecated synchronous method + `FirebaseRemoteConfig.setConfigSettings(FirebaseRemoteConfigSettings)`. Use the asynchronous + [`FirebaseRemoteConfig.setConfigSettingsAsync(FirebaseRemoteConfigSettings)`]() instead. -* [removed] Removed the deprecated method - `FirebaseRemoteConfig.getByteArray(String)`. Use - [`FirebaseRemoteConfig.getString(String)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#getString(String)) +- [removed] Removed the deprecated method `FirebaseRemoteConfig.getByteArray(String)`. Use + [`FirebaseRemoteConfig.getString(String)`]() instead. -* [removed] Removed the deprecated methods - `FirebaseRemoteConfigSettings.isDeveloperModeEnabled()` and - `FirebaseRemoteConfigSettings.Builder.setDeveloperModeEnabled(boolean)`. Use - [`FirebaseRemoteConfigSettings#getMinimumFetchIntervalInSeconds()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigSettings#getMinimumFetchIntervalInSeconds()) - and [`FirebaseRemoteConfigSettings.Builder#setMinimumFetchIntervalInSeconds(long)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigSettings.Builder#setMinimumFetchIntervalInSeconds(long)) +- [removed] Removed the deprecated methods `FirebaseRemoteConfigSettings.isDeveloperModeEnabled()` + and `FirebaseRemoteConfigSettings.Builder.setDeveloperModeEnabled(boolean)`. Use + [`FirebaseRemoteConfigSettings#getMinimumFetchIntervalInSeconds()`]() + and + [`FirebaseRemoteConfigSettings.Builder#setMinimumFetchIntervalInSeconds(long)`]() instead. - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.2.0 -* [changed] Migrated to use the [firebase_installations] service _directly_ - instead of using an indirect dependency via the Firebase Instance ID SDK. + +- [changed] Migrated to use the [firebase_installations] service _directly_ instead of using an + indirect dependency via the Firebase Instance ID SDK. {% include "docs/reference/android/client/_includes/_iid-indirect-dependency-solutions.html" %} -* [changed] Updated the protocol buffer dependency to the newer - `protobuf-javalite` artifact. The new artifact is incompatible with the old - one, so this library needed to be upgraded to avoid conflicts. No developer - action is necessary. +- [changed] Updated the protocol buffer dependency to the newer `protobuf-javalite` artifact. The + new artifact is incompatible with the old one, so this library needed to be upgraded to avoid + conflicts. No developer action is necessary. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.1.4 -* [changed] Updated dependency on the Firebase Instance ID library to v20.1.5, - which is a step towards a direct dependency on the Firebase installations - service in a future release. +- [changed] Updated dependency on the Firebase Instance ID library to v20.1.5, which is a step + towards a direct dependency on the Firebase installations service in a future release. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.1.3 -* [fixed] Fixed an issue where [`FirebaseRemoteConfig.fetch()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig.html#fetch()) -would sometimes report a misformatted language tag. +- [fixed] Fixed an issue where + [`FirebaseRemoteConfig.fetch()`]() + would sometimes report a misformatted language tag. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.1.2 -* [fixed] Resolved known issue where + +- [fixed] Resolved known issue where [`FirebaseRemoteConfigSettings.Builder.setFetchTimeoutInSeconds()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigSettings.Builder) was not always honored. - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.1.1 -* [changed] Updated [`FirebaseRemoteConfig.fetch()`](docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig.html#fetch()) -implementation to use [`FirebaseInstanceId.getInstanceId()`](/docs/reference/android/com/google/firebase/iid/FirebaseInstanceId.html#getInstanceId()) -in favor of the deprecated [`FirebaseInstanceId.getToken()`](/docs/reference/android/com/google/firebase/iid/FirebaseInstanceId.html#getToken()). +- [changed] Updated + [`FirebaseRemoteConfig.fetch()`]() + implementation to use + [`FirebaseInstanceId.getInstanceId()`]() + in favor of the deprecated + [`FirebaseInstanceId.getToken()`](). ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.1.0 -* [changed] Added getters to the fields of the + +- [changed] Added getters to the fields of the [`FirebaseRemoteConfigSettings.Builder`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigSettings.Builder) object to provide better Kotlin patterns. - ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.0.4 -* [fixed] Resolved - [known issue](//github.com/firebase/firebase-android-sdk/issues/973) where - network calls may fail on devices using API 19 and earlier. +- [fixed] Resolved [known issue](//github.com/firebase/firebase-android-sdk/issues/973) where + network calls may fail on devices using API 19 and earlier. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.0.3 -* [fixed] Resolved - [known issue](https://github.com/firebase/firebase-android-sdk/issues/787) - where the [firebase_remote_config] SDK threw an error when Android - [StrictMode](https://developer.android.com/reference/android/os/StrictMode) - was turned on. -* [fixed] Resolved issue where setting Byte Arrays via - [`FirebaseRemoteConfig.setDefaultsAsync(int)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(int)), - [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(Map)) - and their synchronous counterparts would cause `getByteArray` to return an - object reference instead of the Byte Array. Byte Arrays set via the - Firebase console were unaffected by this bug. +- [fixed] Resolved [known issue](https://github.com/firebase/firebase-android-sdk/issues/787) where + the [firebase_remote_config] SDK threw an error when Android + [StrictMode](https://developer.android.com/reference/android/os/StrictMode) was turned on. +- [fixed] Resolved issue where setting Byte Arrays via + [`FirebaseRemoteConfig.setDefaultsAsync(int)`](), + [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](>) + and their synchronous counterparts would cause `getByteArray` to return an object reference + instead of the Byte Array. Byte Arrays set via the Firebase console were unaffected by this bug. ## Kotlin -The Kotlin extensions library transitively includes the updated -`firebase-config` library. The Kotlin extensions library has no additional -updates. + +The Kotlin extensions library transitively includes the updated `firebase-config` library. The +Kotlin extensions library has no additional updates. # 19.0.2 -* [unchanged] Updated to accommodate the release of the [remote_config] - Kotlin extensions library. +- [unchanged] Updated to accommodate the release of the [remote_config] Kotlin extensions library. ## Kotlin -* [feature] The beta release of a [remote_config] Android library with - Kotlin extensions is now available. The Kotlin extensions library transitively - includes the base `firebase-config` library. To learn more, visit the + +- [feature] The beta release of a [remote_config] Android library with Kotlin extensions is now + available. The Kotlin extensions library transitively includes the base `firebase-config` library. + To learn more, visit the [[remote_config] KTX documentation](/docs/reference/kotlin/com/google/firebase/remoteconfig/ktx/package-summary). # 19.0.1 -* [fixed] Resolved known issue where certain unicode characters were not - encoded correctly. The issue was introduced in v19.0.0. + +- [fixed] Resolved known issue where certain unicode characters were not encoded correctly. The + issue was introduced in v19.0.0. # 19.0.0 -* [changed] Versioned to add nullability annotations to improve the Kotlin - developer experience. No other changes. + +- [changed] Versioned to add nullability annotations to improve the Kotlin developer experience. No + other changes. # 17.0.0 -* [feature] Added an asynchronous way to set config settings: [`FirebaseRemoteConfig.setConfigSettingsAsync(FirebaseRemoteConfigSettings)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setConfigSettingsAsync(FirebaseRemoteConfigSettings)). -* [feature] Added [`FirebaseRemoteConfigServerException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigServerException) and [`FirebaseRemoteConfigClientException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientException) to provide more nuanced error reporting. -* [changed] Updated all "cache expiration" references to "minimum fetch interval" and "cache" references to "local storage". -* [deprecated] Deprecated developer mode. Use [`FirebaseRemoteConfigSettings.Builder.setMinimumFetchIntervalInSeconds(0L)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigSettings.Builder#setMinimumFetchIntervalInSeconds(long)) instead. -* [deprecated] Deprecated the synchronous [`FirebaseRemoteConfig.setConfigSettings(FirebaseRemoteConfigSettings)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setConfigSettings(FirebaseRemoteConfigSettings)). Use the asynchronous [`FirebaseRemoteConfig.setConfigSettingsAsync(FirebaseRemoteConfigSettings)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setConfigSettingsAsync(FirebaseRemoteConfigSettings)) instead. -* [deprecated] Deprecated [`FirebaseRemoteConfigFetchException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigFetchException). Use the more granular [`FirebaseRemoteConfigServerException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigServerException) and [`FirebaseRemoteConfigClientException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientException) instead. -* [removed] Removed all namespace methods. -* [removed] Removed all default constructors for Exception classes. -* [changed] Updated minSdkVersion to API level 16. + +- [feature] Added an asynchronous way to set config settings: + [`FirebaseRemoteConfig.setConfigSettingsAsync(FirebaseRemoteConfigSettings)`](). +- [feature] Added + [`FirebaseRemoteConfigServerException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigServerException) + and + [`FirebaseRemoteConfigClientException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientException) + to provide more nuanced error reporting. +- [changed] Updated all "cache expiration" references to "minimum fetch interval" and "cache" + references to "local storage". +- [deprecated] Deprecated developer mode. Use + [`FirebaseRemoteConfigSettings.Builder.setMinimumFetchIntervalInSeconds(0L)`]() + instead. +- [deprecated] Deprecated the synchronous + [`FirebaseRemoteConfig.setConfigSettings(FirebaseRemoteConfigSettings)`](). + Use the asynchronous + [`FirebaseRemoteConfig.setConfigSettingsAsync(FirebaseRemoteConfigSettings)`]() + instead. +- [deprecated] Deprecated + [`FirebaseRemoteConfigFetchException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigFetchException). + Use the more granular + [`FirebaseRemoteConfigServerException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigServerException) + and + [`FirebaseRemoteConfigClientException`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientException) + instead. +- [removed] Removed all namespace methods. +- [removed] Removed all default constructors for Exception classes. +- [changed] Updated minSdkVersion to API level 16. # 16.5.0 -* [feature] Enabled multi-App support. Use [`FirebaseRemoteConfig.getInstance(FirebaseApp)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#getInstance(FirebaseApp)) to retrieve a singleton instance of [`FirebaseRemoteConfig`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig) for the given [`FirebaseApp`](/docs/reference/android/com/google/firebase/FirebaseApp). -* [feature] Added a method that fetches configs and activates them: [`FirebaseRemoteConfig.fetchAndActivate()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#fetchAndActivate()). -* [feature] Network connection timeout for fetch requests is now customizable. To set the network timeout, use [`FirebaseRemoteConfigSettings.Builder.setFetchTimeoutInSeconds(long)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigSettings.Builder#setFetchTimeoutInSeconds(long)). -* [feature] The default minimum fetch interval is now customizable. To set the default minimum fetch interval, use [`FirebaseRemoteConfigSettings.Builder.setMinimumFetchIntervalInSeconds(long)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfigSettings.Builder#setMinimumFetchIntervalInSeconds(long)). -* [feature] Added a way to get all activated configs as a Java `Map`: [`FirebaseRemoteConfig.getAll()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#getAll()). -* [feature] Added the ability to reset a Firebase Remote Config instance: [`FirebaseRemoteConfig.reset()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#reset()). -* [feature] Added a way to determine if the Firebase Remote Config instance has finished initializing. To get a task that will complete when the Firebase Remote Config instance is finished initializing, use [`FirebaseRemoteConfig.ensureInitialized()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#ensureInitialized()). -* [feature] Added an asynchronous way to activate configs: [`FirebaseRemoteConfig.activate()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#activate()). -* [feature] Added an asynchronous way to set defaults: [`FirebaseRemoteConfig.setDefaultsAsync(int)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(int)) and [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(Map)). -* [deprecated] Deprecated the synchronous [`FirebaseRemoteConfig.activateFetched()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#activateFetched()). Use the asynchronous [`FirebaseRemoteConfig.activate()`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#activate()) instead. -* [deprecated] Deprecated the synchronous [`FirebaseRemoteConfig.setDefaults(int)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaults(int)) and [`FirebaseRemoteConfig.setDefaults(Map)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefalts(Map)). Use the asynchronous [`FirebaseRemoteConfig.setDefaultsAsync(int)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(int)) and [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#setDefaultsAsync(Map)) instead. -* [deprecated] Deprecated [`FirebaseRemoteConfig.getByteArray(String)`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig#getByteArray(String)). -* [deprecated] Deprecated all methods with a namespace parameter. + +- [feature] Enabled multi-App support. Use + [`FirebaseRemoteConfig.getInstance(FirebaseApp)`]() + to retrieve a singleton instance of + [`FirebaseRemoteConfig`](/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig) + for the given [`FirebaseApp`](/docs/reference/android/com/google/firebase/FirebaseApp). +- [feature] Added a method that fetches configs and activates them: + [`FirebaseRemoteConfig.fetchAndActivate()`](). +- [feature] Network connection timeout for fetch requests is now customizable. To set the network + timeout, use + [`FirebaseRemoteConfigSettings.Builder.setFetchTimeoutInSeconds(long)`](). +- [feature] The default minimum fetch interval is now customizable. To set the default minimum fetch + interval, use + [`FirebaseRemoteConfigSettings.Builder.setMinimumFetchIntervalInSeconds(long)`](). +- [feature] Added a way to get all activated configs as a Java `Map`: + [`FirebaseRemoteConfig.getAll()`](). +- [feature] Added the ability to reset a Firebase Remote Config instance: + [`FirebaseRemoteConfig.reset()`](). +- [feature] Added a way to determine if the Firebase Remote Config instance has finished + initializing. To get a task that will complete when the Firebase Remote Config instance is + finished initializing, use + [`FirebaseRemoteConfig.ensureInitialized()`](). +- [feature] Added an asynchronous way to activate configs: + [`FirebaseRemoteConfig.activate()`](). +- [feature] Added an asynchronous way to set defaults: + [`FirebaseRemoteConfig.setDefaultsAsync(int)`]() + and + [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](>). +- [deprecated] Deprecated the synchronous + [`FirebaseRemoteConfig.activateFetched()`](). + Use the asynchronous + [`FirebaseRemoteConfig.activate()`]() + instead. +- [deprecated] Deprecated the synchronous + [`FirebaseRemoteConfig.setDefaults(int)`]() + and + [`FirebaseRemoteConfig.setDefaults(Map)`](>). + Use the asynchronous + [`FirebaseRemoteConfig.setDefaultsAsync(int)`]() + and + [`FirebaseRemoteConfig.setDefaultsAsync(Map)`](>) + instead. +- [deprecated] Deprecated + [`FirebaseRemoteConfig.getByteArray(String)`](). +- [deprecated] Deprecated all methods with a namespace parameter. # 16.4.1 -* [changed] The SDK now enforces Android API Key restrictions. -* [fixed] Resolved known issue where the local cache was not honored even if - it had not expired. The issue was introduced in version 16.3.0. + +- [changed] The SDK now enforces Android API Key restrictions. +- [fixed] Resolved known issue where the local cache was not honored even if it had not expired. The + issue was introduced in version 16.3.0. # 16.4.0 -* [changed] Internal changes to ensure functionality alignment with other SDK releases. + +- [changed] Internal changes to ensure functionality alignment with other SDK releases. # 16.3.0 -* [changed] The [firebase_remote_config] SDK requires the - [firebase_remote_config] REST API. For Firebase projects created before - March 7, 2018, you must manually enable the REST API. For more information, - see our + +- [changed] The [firebase_remote_config] SDK requires the [firebase_remote_config] REST API. For + Firebase projects created before March 7, 2018, you must manually enable the REST API. For more + information, see our [[remote_config] REST API user guide](https://firebase.google.com/docs/remote-config/use-config-rest#before_you_begin_enable_the_rest_api). -* [changed] Refactored the implementation of [remote_config] to improve SDK - stability and speed, and to remove the Google Play Services dependency. -* [changed] Improved error logs and exception messages. -* [changed] Updated the Android documentation to reflect that - [remote_config] uses `Locale` to retrieve location information, similar to - iOS's use of `countryCode`. +- [changed] Refactored the implementation of [remote_config] to improve SDK stability and speed, and + to remove the Google Play Services dependency. +- [changed] Improved error logs and exception messages. +- [changed] Updated the Android documentation to reflect that [remote_config] uses `Locale` to + retrieve location information, similar to iOS's use of `countryCode`. # 16.1.3 -* [fixed] Fixed an issue where [remote_config] experiments were not - collecting results. + +- [fixed] Fixed an issue where [remote_config] experiments were not collecting results. # 16.1.0 -* [fixed] Bug fixes and internal improvements to support Firebase Performance Monitoring features. +- [fixed] Bug fixes and internal improvements to support Firebase Performance Monitoring features. diff --git a/firebase-config/test-app/README.md b/firebase-config/test-app/README.md index 64149202d50..b8994701353 100644 --- a/firebase-config/test-app/README.md +++ b/firebase-config/test-app/README.md @@ -2,16 +2,16 @@ ## Setup -Download the `google-services.json` file -from [Firebase Console](https://console.firebase.google.com/) (for whatever Firebase project you -have or want to integrate the `test-app`) and store it under the current directory. +Download the `google-services.json` file from +[Firebase Console](https://console.firebase.google.com/) (for whatever Firebase project you have or +want to integrate the `test-app`) and store it under the current directory. Note: The [Package name](https://firebase.google.com/docs/android/setup#register-app) for your app -created on the Firebase Console (for which the `google-services.json` is downloaded) must match -the [applicationId](https://developer.android.com/studio/build/application-id.html) declared in -the `test-app/test-app.gradle.kts` for the app to link to Firebase. +created on the Firebase Console (for which the `google-services.json` is downloaded) must match the +[applicationId](https://developer.android.com/studio/build/application-id.html) declared in the +`test-app/test-app.gradle.kts` for the app to link to Firebase. ## Running -Run the test app directly from Android Studio by selecting and running -the `firebase-config.test-app` run configuration. +Run the test app directly from Android Studio by selecting and running the +`firebase-config.test-app` run configuration. diff --git a/firebase-crashlytics-ndk/CHANGELOG.md b/firebase-crashlytics-ndk/CHANGELOG.md index 0f9763a12f5..ea779464dcd 100644 --- a/firebase-crashlytics-ndk/CHANGELOG.md +++ b/firebase-crashlytics-ndk/CHANGELOG.md @@ -1,78 +1,103 @@ # Unreleased -* [changed] Updated `firebase-crashlytics` dependency to 20.0.1 + +- [changed] Updated `firebase-crashlytics` dependency to 20.0.1 # 20.0.0 -* [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. + +- [changed] **Breaking Change**: Updated minSdkVersion to API level 23 or higher. # 19.4.4 -* [changed] Updated `firebase-crashlytics` dependency to v19.4.4 + +- [changed] Updated `firebase-crashlytics` dependency to v19.4.4 # 19.4.3 -* [changed] Updated internal Crashpad version to commit `21a20e`. + +- [changed] Updated internal Crashpad version to commit `21a20e`. # 19.4.2 -* [changed] Updated `firebase-crashlytics` dependency to v19.4.2 + +- [changed] Updated `firebase-crashlytics` dependency to v19.4.2 # 19.4.1 -* [changed] Updated `firebase-crashlytics` dependency to v19.4.1 + +- [changed] Updated `firebase-crashlytics` dependency to v19.4.1 # 19.3.0 -* [changed] Updated `firebase-crashlytics` dependency to v19.3.0 + +- [changed] Updated `firebase-crashlytics` dependency to v19.3.0 # 19.2.1 -* [changed] Updated `firebase-crashlytics` dependency to v19.2.1 + +- [changed] Updated `firebase-crashlytics` dependency to v19.2.1 # 19.2.0 -* [changed] Updated `firebase-crashlytics` dependency to v19.2.0 + +- [changed] Updated `firebase-crashlytics` dependency to v19.2.0 # 19.1.0 -* [changed] Updated `firebase-crashlytics` dependency to v19.1.0 + +- [changed] Updated `firebase-crashlytics` dependency to v19.1.0 # 19.0.3 -* [changed] Updated `firebase-crashlytics` dependency to v19.0.3 + +- [changed] Updated `firebase-crashlytics` dependency to v19.0.3 # 19.0.2 -* [changed] Update libcrashlytics to support 16 kb page sizes. + +- [changed] Update libcrashlytics to support 16 kb page sizes. # 19.0.1 -* [changed] Updated `firebase-crashlytics` dependency to v19.0.1 + +- [changed] Updated `firebase-crashlytics` dependency to v19.0.1 # 19.0.0 -* [changed] Bump internal dependencies + +- [changed] Bump internal dependencies # 18.6.3 -* [changed] Updated `firebase-crashlytics` dependency to v18.6.3 + +- [changed] Updated `firebase-crashlytics` dependency to v18.6.3 # 18.6.0 -* [changed] Updated `firebase-crashlytics` dependency to v18.6.0 + +- [changed] Updated `firebase-crashlytics` dependency to v18.6.0 # 18.5.0 -* [changed] Updated `firebase-crashlytics` dependency to v18.5.0 + +- [changed] Updated `firebase-crashlytics` dependency to v18.5.0 # 18.4.3 -* [changed] Updated `firebase-crashlytics` dependency to v18.4.3 + +- [changed] Updated `firebase-crashlytics` dependency to v18.4.3 # 18.4.2 -* [changed] Updated `firebase-crashlytics` dependency to v18.4.2 + +- [changed] Updated `firebase-crashlytics` dependency to v18.4.2 # 18.4.1 -* [changed] Updated `firebase-crashlytics` dependency to v18.4.1 + +- [changed] Updated `firebase-crashlytics` dependency to v18.4.1 # 18.4.0 -* [changed] Updated `firebase-crashlytics` dependency to v18.4.0 + +- [changed] Updated `firebase-crashlytics` dependency to v18.4.0 # 18.3.7 -* [changed] Updated `firebase-crashlytics` dependency to v18.3.7 + +- [changed] Updated `firebase-crashlytics` dependency to v18.3.7 # 18.3.6 -* [changed] Updated `firebase-crashlytics` dependency to v18.3.6. + +- [changed] Updated `firebase-crashlytics` dependency to v18.3.6. # 18.3.5 -* [fixed] Updated `firebase-common` to its latest version (v20.3.0) to fix an - issue that was causing a nondeterministic crash on startup. -* [changed] Updated `firebase-crashlytics` dependency to v18.3.5. + +- [fixed] Updated `firebase-common` to its latest version (v20.3.0) to fix an issue that was causing + a nondeterministic crash on startup. +- [changed] Updated `firebase-crashlytics` dependency to v18.3.5. # 18.3.4 +