파이어베이스 앱 등록 (안드로이드)

1) 앱 등록

notion image
  • 서명키 SHA1 해쉬값 조회하기
$ keytool -list -alias [별칭이름] -keystore [키스토어이름]
 

2) 구성 파일 다운로드

notion image
[프로젝트경로]/android/app/google-services.json
notion image

3) Firebase SDK 추가

프로젝트 수준의 build.gradle 파일 수정

[프로젝트경로]/android/build.gradle
buildscript { repositories { // Check that you have the following line (if not, add it): google() // Google's Maven repository } dependencies { ... // Add this line classpath 'com.google.gms:google-services:4.3.5' } } allprojects { ... repositories { // Check that you have the following line (if not, add it): google() // Google's Maven repository ... } }

앱 수준의 build.gradle 파일 수정

[프로젝트경로]/android/app/build.gradle
apply plugin: 'com.android.application' // Add this line apply plugin: 'com.google.gms.google-services' dependencies { // Import the Firebase BoM implementation platform('com.google.firebase:firebase-bom:26.4.0') // Add the dependency for the Firebase SDK for Google Analytics // When using the BoM, don't specify versions in Firebase dependencies implementation 'com.google.firebase:firebase-analytics' // Add the dependencies for any other desired Firebase products // https://firebase.google.com/docs/android/setup#available-libraries }