Step7 Setup Firebase
In this step, we are going to
- setup firebase.
Setup firebase
Let's follow this official guide:
https://codelabs.developers.google.com/codelabs/flutter-firebase/#5
Summery of setup guide
- Open
app/build.gradle
and copy package name - Download
google-services.json
and move toandroid/app/google-services.json
- Open
android/build.gradle
and addclasspath 'com.google.gms:google-services:4.3.2'
- Open
android/app/build.gradle
and addapply plugin: 'com.google.gms.google-services'
andimplementation 'com.google.firebase:firebase-analytics:17.2.0'
- Uninstall app from emulator and restart
Enable Authentication Sign-in method
Don't forget to enable "Email/Password" method.
Security tip
tip
Should I add the google-services.json (from Firebase) to my repository? https://stackoverflow.com/questions/37358340/should-i-add-the-google-services-json-from-firebase-to-my-repository
According to this stackoverflow question, I think it is good to ignore google-services.json
in .gitignore
So, in project root .gitignore
file,
.gitignore
...
google-services.json