An android project which implements all java libraries and code required for Firebase auth with custom token.
NOTE: Please note that such app is only good for testing/ debugging purposes.
Using this project to create production build of the app is NOT recommended.
You should never ship your Firebase Secret in your app.
-
Create new android studio project.
-
In your app
build.gradlefile under android add
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}- In your app
build.gradlefile under dependencies add
compile 'com.firebase:firebase-client-android:2.5.2+'-
Sync project with gradle files (you may find a button to do so in andorid studio action bar)
-
In your
AndroidManifest.xmladd
<uses-permission android:name="android.permission.INTERNET" />- Under
MyApplication/app/libsadd
commons-codec-1.7.jar
json-20090211.jar(You may find these files in the same location in this project)
- Under
MyApplication/app/src/java/<your_application>add Folder
FirebaseTokenGenerator(You may find these files in the same location in this project)
-
Copy required code from
MainActivityto your desired activity in your project -
Add your firebase link and secret in your
strings.xml(or in some class if you are planning to better obfuscate these strings.)