- [added]
FirebaseOptions.Builder
class now provides asetFirestoreOptions()
method for configuring the Firestore client. - [changed] Upgraded the Cloud Firestore client to 0.61.0-beta.
- [changed] Upgraded the Cloud Storage client to 1.43.0.
- [added]
WebpushNotification
type now supports arbitrary key-value pairs in its payload.
- [added] Implemented the ability to create custom tokens without service account credentials.
- [added] Added the
setServiceAccount()
method to theFirebaseOptions.Builder
API. - [added] The SDK can now read the Firebase/GCP project ID from both
GCLOUD_PROJECT
andGOOGLE_CLOUD_PROJECT
environment variables.
- [added] Added new
importUsersAsync()
API for bulk importing users into Firebase Auth.
- [changed] Deprecated the
FirebaseAuth.setCustomClaims()
method. Developers should use theFirebaseAuth.setCustomUserClaims()
method instead.
- [added]
FirebaseAuth
,FirebaseMessaging
andFirebaseInstanceId
interfaces now expose a set of blocking methods. Each operation has blocking an asynchronous versions. - [changed] Removed the deprecated
FirebaseCredential
interface. - [changed] Removed the deprecated
Task
interface along with thecom.google.firebase.tasks
package. - [changed] Dropped support for App Engine's Java 7 runtime. Developers are advised to use the Admin SDK with Java 8 when deploying to App Engine.
- [changed] Removed the deprecated
FirebaseDatabase.setLogLevel()
API and the related logging utilities. Developers should use SLF4J to configure logging directly.
- [added] A new
FirebaseAuth.createSessionCookieAsync()
method for creating a long-lived session cookie given a valid ID token. - [added] A new
FirebaseAuth.verifySessionCookieAsync()
method for verifying a given cookie string is valid. - [fixed] Upgraded Cloud Firestore dependency version to 0.45.0-beta.
- [fixed] Upgraded Cloud Storage dependency version to 1.27.0.
- [fixed] Upgraded Netty dependency version to 4.1.22.
- [fixed] Using the
HttpTransport
specified atFirebaseOptions
inGooglePublicKeysManager
. This enables developers to use a custom transport to fetch public keys when verifying ID tokens and session cookies. - [added] Connection timeout and read timeout for HTTP/REST connections
can now be configured via
FirebaseOptions.Builder
at app initialization. - [added] Added new
setMutableContent()
,putCustomData()
andputAllCustomData()
methods to theAps.Builder
API. - [fixed] Improved error handling in FCM by mapping more server-side errors to client-side error codes.
- [feature] Added the
FirebaseCloudMessaging
API for sending Firebase notifications and managing topic subscriptions.
- [added] The
verifyIdTokenAsync()
method has an overload that accepts a booleancheckRevoked
parameter. Whentrue
, an additional check is performed to see whether the token has been revoked. - [added] A new
revokeRefreshTokensAsync()
method has been added to invalidate all tokens issued to a user. - [added] A new getter
getTokensValidAfterTimestamp()
has been added to theUserRecord
class, which denotes the time before which tokens are not valid.
- [fixed] Exceptions thrown by database event handlers are now logged.
- [fixed] The
FirebaseOptions.Builder.setStorageBucket()
method now throws a clear exception when invoked with a bucket URL instead of the name. - [fixed] Implemented a fix for a potential Guava version conflict which
was causing an
IllegalStateException
(precondition failure) in some environments.
- [fixed] Upgraded the Cloud Firestore client to the latest available version.
- [added] The
FirebaseApp.initializeApp()
method now provides an overload that does not require any arguments. This initializes an app using Google Application Default Credentials, and otherFirebaseOptions
loaded from theFIREBASE_CONFIG
environment variable.
- [changed] Improved error handling in user management APIs in the
FirebaseAuth
class. These operations now throw exceptions with well-defined error codes.
- [changed] The SDK now serializes large whole double values as longs when appropriate.
- [added] A new
FirebaseInstanceId
API that facilitates deleting instance IDs and associated user data from Firebase projects.
- [changed] No longer using
org.json
dependency in Authentication APIs, which makes it easier to use the API in environments with conflicting JSON libraries.
- [changed] Upgraded the version of Google API Common dependency to the latest (1.2.0).
- [added] Added the
listUsersAsync()
method to theFirebaseAuth
class. This method enables listing or iterating over all user accounts in a Firebase project. - [added] Added the
[
setCustomUserClaimsAsync()
](https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/auth/FirebaseAuth.html#setCustomUserClaimsAsync(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)) method to theFirebaseAuth
class. This method enables setting custom claims on a Firebase user. The custom claims can be accessed via that user's ID token.
- [changed] Re-implemented the WebSocket communication layer of the Realtime Database client using Netty.
- [added] A new
FirestoreClient
API that enables access to Cloud Firestore databases.
- [changed] Ensured graceful termination of database worker threads upon
callng
FirebaseApp.delete()
.
- [added] A new
ThreadManager
API that can be used to specify the thread pool and theThreadFactory
that should be used by the SDK. - [added] All APIs that support asynchronous operations now return an
ApiFuture
. The oldTask
API has been deprecated. For each methodx()
that returns aTask
, a newxAsync()
method that returns anApiFuture
has been introduced. - [changed] The SDK now guarantees the graceful termination of all started
threads. In most environments, the SDK will use daemons for all background
activities. The developer can also initiate a graceful termination of threads
by calling
FirebaseApp.delete()
.
- [added]
FirebaseOptions
can now be initialized withGoogleCredentials
. This is the new recommended way to specify credentials when initializing the SDK. The oldFirebaseCredential
andFirebaseCredentials
APIs have been deprecated.
- [changed] Throwing an accurate and more detailed error from
verifyIdToken()
in the event of a low-level exception.
- [changed] Proper handling and logging of exceptions thrown by the
[
onComplete()
](https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/database/Transaction.Handler.html#onComplete(com.google.firebase.database.DatabaseError, boolean, com.google.firebase.database.DataSnapshot)) event of transaction handlers.
- [added] A new {{firebase_storage}} API
that facilitates accessing Google Cloud Storage buckets using the
google-cloud-storage
library. - [added] Integrated with the SLF4J library for all logging purposes.
- [added] Added the method
getUserByPhoneNumber()
to theFirebaseAuth
interface. This method enables retrieving user profile information by a phone number. - [added]
CreateRequest
andUpdateRequest
types now provide setters for specifying a phone number, which can be used to create users with a phone number field and/or update the phone number associated with a user. - [added] Added the
getPhoneNumber()
method toUserRecord
, which exposes the phone number associated with a user account. - [added] Added the
getPhoneNumber()
method toUserInfo
, which exposes the phone number associated with a user account by a linked identity provider.
- {{changed}} Deprecated the
FirebaseDatabase.setLogLevel()
method. Use SLF4J to configure logging. - [changed] Logging a detailed error when the database client fails to authenticate with the backend Firebase servers.
- [added] New factory methods in the
FirebaseCredentials
class that acceptHttpTransport
andJsonFactory
arguments. These settings are used when the credentials make HTTP calls to obtain OAuth2 access tokens. - [added] New
setHttpTransport()
andsetJsonFactory()
methods in theFirebaseOptions
class. These settings are used by all services of the SDK exceptFirebaseDatabase
.
- [added] A new user management API that allows provisioning and managing
Firebase users from Java applications. This API adds
getUser()
,getUserByEmail()
,createUser()
,updateUser()
anddeleteUser()
methods to theFirebaseAuth
interface.
- [changed] Fixed a database API thread leak that made the SDK unstable when running in the Google App Engine environment.
- [added] Factory methods in
FirebaseCredentials
class can now throwIOExceptions
, providing fail-fast semantics while facilitating simpler error handling. - [added] The deprecated
setServiceAccount()
method has been removed from theFirebaseOptions.Builder
class in favor of thesetCredential()
method. - [added] Trying to initialize the SDK without setting a credential now results in an exception.
- {{changed}} The
FirebaseCredential
interface now returns a newGoogleOAuthAccessToken
type, which encapsulates both token string and its expiry time.
-
[added] Introducing a new
FirebaseApp.delete()
method, which can be used to gracefully shut down app instances. All app invocations after a call todelete()
will throw exceptions. Deleted app instances can also be re-initialized with the same name if necessary. -
[changed] Upgraded SDK dependencies. Guava, Google API Client, and JSON libraries that the SDK depends on have been upgraded to more recent versions.
- [changed] Updated the SDK to select the correct thread pool
implementation when running on a regular JVM with App Engine
libraries in the
classpath
.
- [changed] Fixed the invalid SDK version constant in the
FirebaseDatabase
class that was released in v4.1.4.
- [changed] Updated the SDK to periodically refresh the OAuth access token
internally used by
FirebaseApp
. This reduces the number of authentication failures encountered at runtime by various SDK components (e.g. Realtime Database) to nearly zero. This feature is active by default when running in typical Java environments, or the Google App Engine environment with background threads support.
- [changed] Updated Realtime Database to properly swap out the ID token used to
authenticate the underlying websocket when a new ID token is generated. The
websocket connection is still disconnected and reconnected every hour when an
ID token expires unless you manually call
getAccessToken
on theFirebaseCredential
used to authenticate the SDK. In a future release, the SDK will proactively refresh ID tokens automatically before they expire.
- [changed] Updated
initalizeApp()
to synchronously read from anInputStream
to avoid issues with closing the stream after initializing the SDK. - [changed] Improved confusing error messages when initializing the SDK with
a
null
or malformedInputStream
.
- [changed] Fixed a dependency issue which caused the
verifyIdToken()
method to always throw an exception.
- {{deprecated}} The
FirebaseOptions.Builder.setServiceAccount()
method has been deprecated in favor of a newFirebaseOptions.Builder.setCredential()
method. See Initialize the SDK for usage instructions. - [added] The new
FirebaseCredential.fromCertificate()
method allows you to authenticate the SDK with a service account certificate file. - [added] The new
FirebaseCredential.fromRefreshToken()
method allows you to authenticate the SDK with a Google OAuth2 refresh token. - [added] The new
FirebaseCredential.applicationDefault()
method allows you to authenticate the SDK with Google Application Default Credentials.
- [issue] The
verifyIdToken()
method is broken in this release and throws an exception due to an incorrect dependency. This was fixed in version4.1.1
.
- [changed] Fixed issue which caused threads to be terminated in Google App Engine after 24 hours, rendering the SDK unresponsive.
- [changed] Fixed issues which caused asynchronous task execution to fail on automatically-scaled Google App Engine instances.
- [added] Improved error messages and added App Engine support for the
verifyIdToken()
method.
- [changed] Fixed a race condition which could occur when new writes are added while the connection is being closed.
- [changed] Fixed an issue that caused a
null
input to the [setDatabaseAuthVariableOverride()
](https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/FirebaseOptions.Builder.html#setDatabaseAuthVariableOverride(java.util.Map<java.lang.String, java.lang.Object>)) method to be ignored, which caused the app to still have full admin access. Now, passing this value has the expected behavior: the app has unauthenticated access to the Realtime Database, and behaves as if no user is logged into the app.
- [changed] Use of the
[
updateChildren()
](https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/database/DatabaseReference.html#updateChildren(java.util.Map<java.lang.String, java.lang.Object>)) method now only cancels transactions that are directly included in the updated paths (not transactions in adjacent paths). For example, an update at/move
for a child nodewalk
will cancel transactions at/
,/move
, and/move/walk
and in any child nodes under/move/walk
. But, it will no longer cancel transactions at sibling nodes, such as/move/run
.
- [changed] This update restores Java 7 compatibilty for the Admin Java SDK.
- [changed] Fixed an issue with a missing dependency in the
4.0.0
JAR which caused the Database API to not work. - [issue] This version was compiled for Java 8 and does not support Java 7.
This was fixed in version
4.0.2
.
- [added] The Admin Java SDK (available on Maven as
firebase-admin
) replaces the pre-existingfirebase-server-sdk
Maven package, which is now deprecated. See Add the Firebase Admin SDK to your Server to get started. - [issue] This version is missing a dependency which causes the Database API
to not work. This was fixed in version
4.0.1
. - [issue] This version was compiled for Java 8 and does not support Java 7.
This was fixed in version
4.0.2
.
- [changed] The
createCustomToken()
method is now asynchronous, returning aTask<String>
instead of aString
.