- [added] Added
WebpushFcmOptionsto theFirebaseMessagingAPI, providing thesetLink()method.
- [added] Added
FcmOptions,ApnsFcmOptionsandAndroidFcmOptionsto theFirebaseMessagingAPI, which all provides asetAnalyticsLabel()method. - [changed] Upgraded the Cloud Firestore client to 1.9.0.
- [changed] Upgraded the Cloud Storage client to 1.79.0.
- [changed] Upgraded the Google API client to 1.30.1.
- [fixed] Enabled automatic retries for FCM API calls failing with HTTP 500 and 503 errors.
- [added] Implemented new
sendAll()andsendMulticast()APIs inFirebaseMessaging. - [changed] Removed org.json dependency and replaced with com.google.code.gson.
- [changed] Upgraded Mockito dependency, and fixed the build on Java 11.
- [added] Added
generatePasswordResetLink(),generateEmailVerificationLink()andgenerateSignInWithEmailLink()methods to theFirebaseAuthAPI. Apsclass now supports configuring a critical sound. A newCriticalSoundclass has been introduced for this purpose.- [fixed]
Firestoreinstances initialized by the SDK are now cleaned up, whenFirebaseApp.delete()is called. - [added] Added new
setChannelId()method to theAndroidNotification.BuilderAPI for setting the Android notification channel ID (new in Android O).
- [added] Added a new
FirebaseProjectManagementAPI for managing apps in a Firebase project. - [fixed] Fixing error handling in FCM. The SDK now checks the key
type.googleapis.com/google.firebase.fcm.v1.FcmErrorto set error code. - [fixed] FCM errors sent by the back-end now include more details that are helpful when debugging problems.
- [changed] Migrated the
FirebaseAuthuser management API to the
- [added]
FirebaseOptions.Builderclass 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]
WebpushNotificationtype 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.BuilderAPI. - [added] The SDK can now read the Firebase/GCP project ID from both
GCLOUD_PROJECTandGOOGLE_CLOUD_PROJECTenvironment 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,FirebaseMessagingandFirebaseInstanceIdinterfaces now expose a set of blocking methods. Each operation has blocking an asynchronous versions. - [changed] Removed the deprecated
FirebaseCredentialinterface. - [changed] Removed the deprecated
Taskinterface along with thecom.google.firebase.taskspackage. - [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
HttpTransportspecified atFirebaseOptionsinGooglePublicKeysManager. 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.Builderat app initialization. - [added] Added new
setMutableContent(),putCustomData()andputAllCustomData()methods to theAps.BuilderAPI. - [fixed] Improved error handling in FCM by mapping more server-side errors to client-side error codes.
- [feature] Added the
FirebaseCloudMessagingAPI for sending Firebase notifications and managing topic subscriptions.
- [added] The
verifyIdTokenAsync()method has an overload that accepts a booleancheckRevokedparameter. 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 theUserRecordclass, 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 otherFirebaseOptionsloaded from theFIREBASE_CONFIGenvironment variable.
- [changed] Improved error handling in user management APIs in the
FirebaseAuthclass. 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
FirebaseInstanceIdAPI that facilitates deleting instance IDs and associated user data from Firebase projects.
- [changed] No longer using
org.jsondependency 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 theFirebaseAuthclass. 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 theFirebaseAuthclass. 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
FirestoreClientAPI that enables access to Cloud Firestore databases.
- [changed] Ensured graceful termination of database worker threads upon
callng
FirebaseApp.delete().
- [added] A new
ThreadManagerAPI that can be used to specify the thread pool and theThreadFactorythat should be used by the SDK. - [added] All APIs that support asynchronous operations now return an
ApiFuture. The oldTaskAPI has been deprecated. For each methodx()that returns aTask, a newxAsync()method that returns anApiFuturehas 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]
FirebaseOptionscan now be initialized withGoogleCredentials. This is the new recommended way to specify credentials when initializing the SDK. The oldFirebaseCredentialandFirebaseCredentialsAPIs 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-storagelibrary. - [added] Integrated with the SLF4J library for all logging purposes.
- [added] Added the method
getUserByPhoneNumber()to theFirebaseAuthinterface. This method enables retrieving user profile information by a phone number. - [added]
CreateRequestandUpdateRequesttypes 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
FirebaseCredentialsclass that acceptHttpTransportandJsonFactoryarguments. These settings are used when the credentials make HTTP calls to obtain OAuth2 access tokens. - [added] New
setHttpTransport()andsetJsonFactory()methods in theFirebaseOptionsclass. 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 theFirebaseAuthinterface.
- [changed] Fixed a database API thread leak that made the SDK unstable when running in the Google App Engine environment.
- [added] Factory methods in
FirebaseCredentialsclass can now throwIOExceptions, providing fail-fast semantics while facilitating simpler error handling. - [added] The deprecated
setServiceAccount()method has been removed from theFirebaseOptions.Builderclass in favor of thesetCredential()method. - [added] Trying to initialize the SDK without setting a credential now results in an exception.
- {{changed}} The
FirebaseCredentialinterface now returns a newGoogleOAuthAccessTokentype, 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
FirebaseDatabaseclass 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
getAccessTokenon theFirebaseCredentialused 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 anInputStreamto avoid issues with closing the stream after initializing the SDK. - [changed] Improved confusing error messages when initializing the SDK with
a
nullor 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
nullinput 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/movefor a child nodewalkwill cancel transactions at/,/move, and/move/walkand 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.0JAR 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-sdkMaven 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.