https://firebase.google.com/?hl=ko
접속 후 시작하기 - 프로젝트 추가 - 프로젝트 이름 입력 - 생성 완료
firebase 콘솔에서
안드로이드 아이콘 클릭
프로젝트/android/app/build.gradle 내부 namespace 검색하여
com.~~ 을 Android 패키지 이름에 넣어주고
프로젝트 닉네임 설정 후
keytool -J-Duser.language=en -list -v -alias androiddebugkey -keystore ./android/app/debug.keystore
프로젝트 폴더 내에서 위 명령어 입력하여 SHA-1 인증서 발급
비밀번호 입력 시 그냥 엔터 눌러도 된다
google-services.json 파일을 받아서
프로젝트/android/app 으로 복붙
buildscript {
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
dependencies {
...
// Add the dependency for the Google services Gradle plugin
classpath 'com.google.gms:google-services:4.3.15'
}
}
allprojects {
...
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
}
프로젝트/build.gradle 에 위 코드 각 영역별 추가
apply plugin: "com.google.gms.google-services"
dependencies {
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:31.5.0')
// TODO: Add the dependencies for Firebase products you want to use
// When using the BoM, don't specify versions in Firebase dependencies
// https://firebase.google.com/docs/android/setup#available-libraries
}
프로젝트/app/build.gradle 에 위 코드 각 영역별 추가
앱 추가 - iOS 선택
com.프로젝트명 으로 변경 함
app nick name
프로젝트명으로 설정 함
apple id
app store 등록 시 필요
GoogleService-Info.plist 받고 를
xcode 에서 프로젝트 폴더 내로 이동
3, 4 번은 react-native-firebase 에서 자동으로 설정한다
https://velog.io/@lumpenop/TIL-RN-react-native-firebase-ios-%EC%97%B0%EB%8F%99-2-221114
yarn add @react-native-firebase/app @react-native-firebase/auth @react-native-firebase/firestore @react-native-firebase/storage
xcode 에서 프로젝트 폴더 내에 AppDelegate.mm 파일 내부에
#import "AppDelegate.h"
바로 뒤에
#import <Firebase.h>
추가
didFinishLaunchingWithOptions
메서드 내 최 상단 [FIRApp configure];
추가
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FIRApp configure];
// ...
pod install --repo-update
pod isntall