Firebase and Google Cloud integration
Firebase is used for:
- Authentication
- Realtime NoSQL database
- Analytics and crashlytics
- Machine Learning model deployment
- Remote Config
Google Cloud Platform is required for OAuth2 authentication and accessing Firebase services.
Setup Firebase
- Create a new Firebase project here.
- Add an Android app to the project. Use a distinct package name, NOT
illyan.jay
. - Add Authentication, Firestore Database, Analytics, Crashlytics, Machine Learning, Performance and Remote Config services.
- Select
Project Settings
and downloadgoogle-services.json
. - Don't forget to add the SHA-1 key to the Firebase project settings. You can generate the hey with the command
./gradlew signingReport
. - Setup Authentication to use Google Sign-In.
Google Cloud Platform
To use Firebase services, you need to add the SHA-1 key to the Google Cloud Platform project.
- If not yet done, link your Firebase project to Google Cloud Platform.
- Under
APIs & Services
➡️Credentials
, selectAndroid key (auto created by Firebase)
. - Set application restrictions to
Android apps
and add the SHA-1 key with your package name. - If deploying to production, don't forget to publish OAuth to production. To do that, navigate to
Oath consent screen
underCredentials
menu.