Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.jernkuan:FirebaseUI-Android:'
}
<dependency>
<groupId>com.github.jernkuan</groupId>
<artifactId>FirebaseUI-Android</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.jernkuan" % "FirebaseUI-Android" % ""
:dependencies [[com.github.jernkuan/FirebaseUI-Android ""]]
FirebaseUI is an open-source library for Android that allows you to quickly connect common UI elements to Firebase APIs like the Realtime Database or Firebase Authentication.
A compatible FirebaseUI client is also available for iOS.
FirebaseUI is published as a collection of libraries separated by the Firebase API they target. Each FirebaseUI library has a transitive dependency on the appropriate Firebase SDK so there is no need to include those separately in your app.
In your app/build.gradle
file add a dependency on one of the FirebaseUI
libraries.
dependencies {
// FirebaseUI Database only
compile 'com.firebaseui:firebase-ui-database:1.2.0'
// FirebaseUI Auth only
compile 'com.firebaseui:firebase-ui-auth:1.2.0'
// FirebaseUI Storage only
compile 'com.firebaseui:firebase-ui-storage:1.2.0'
// Single target that includes all FirebaseUI libraries above
compile 'com.firebaseui:firebase-ui:1.2.0'
}
If you're including the firebase-ui-auth
dependency, there's a little
more setup
required.
After the project is synchronized, we're ready to start using Firebase functionality in our app.
FirebaseUI libraries have the following transitive dependencies on the Firebase SDK:
firebase-ui-auth
|--- com.google.firebase:firebase-auth
|--- com.google.android.gms:play-services-auth
firebase-ui-database
|--- com.google.firebase:firebase-database
firebase-ui-storage
|--- com.google.firebase:firebase-storage
Each version of FirebaseUI has dependency on a fixed version of these libraries, defined as the variable firebase_version
in common/constants.gradle
. If you are using any dependencies in your app of the form
compile 'com.google.firebase:firebase-*:x.y.z'
or compile 'com.google.android.gms:play-services-*:x.y.z'
you need to make sure that you use the same version that your chosen version of FirebaseUI requires.
For convenience, here are some examples:
| FirebaseUI Version | Firebase/Play Services Version | |--------------------|--------------------------------| | 1.2.0 | 10.2.0 | | 1.1.1 | 10.0.0 or 10.0.1 | | 1.0.1 | 10.0.0 or 10.0.1 | | 1.0.0 | 9.8.0 | | 0.6.2 | 9.8.0 | | 0.6.1 | 9.6.1 | | 0.6.0 | 9.6.0 | | 0.5.3 | 9.4.0 | | 0.4.4 | 9.4.0 | | 0.4.3 | 9.2.1 | | 0.4.2 | 9.2.0 | | 0.4.1 | 9.0.2 | | 0.4.0 | 9.0.0 |
There is a sample app in the app/
directory that demonstrates most
of the features of FirebaseUI. Load the project in Android Studio and
run it on your Android device to see a demonstration.
Before you can run the sample app, you must create a project in
the Firebase console. Add an Android app to the project, and copy
the generated google-services.json file into the app/
directory.
Also enable anonymous authentication
for the Firebase project, since some components of the sample app
requires it.
If you encounter a version incompatibility error between Android Studio and Gradle while trying to run the sample app, try disabling the Instant Run feature of Android Studio. Alternatively, update Android Studio and Gradle to their latest versions.
You can download FirebaseUI and install it locally by cloning this repository and running:
./gradlew :library:prepareArtifacts :library:publishAllToMavenLocal
To deploy FirebaseUI to Bintray
BINTRAY_USER
and BINTRAY_KEY
in your environment. You must
be a member of the firebaseui Bintray organization../gradlew clean :library:prepareArtifacts :library:bintrayUploadAll
common/constants.gradle
We'd love to accept your sample apps and patches! Before we can take them, we have to jump a couple of legal hurdles.
Please fill out either the individual or corporate Contributor License Agreement (CLA).
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.