파이어베이스 통합 소개
설치
개요
개요 제목이 튜토리얼은 Capacitor Social Login 플러그인을 사용하여 Firebase 인증과 통합하는 방법을 안내합니다. 이 통합은 native social login 제공자 (Google, Apple, Facebook, Twitter)를 모바일 플랫폼에서 사용하고 Firebase Auth를 사용하여 백엔드 인증 및 Firestore를 사용하여 데이터 저장소를 사용할 수 있도록 합니다.
학습할 내용
학습할 내용 제목- Firebase 인증을 구성하는 방법
- Firebase Auth와 Capacitor Social Login 플러그인을 통합하는 방법
- Android, iOS 및 Web 플랫폼에 대한 설정
시작하기 전에 다음을 확인하세요.
-
Firebase Project
- 프로젝트를 생성하세요. Firebase Console
- 인증을 활성화하세요 (이메일/비밀번호 및 Google Sign-In)
- Firebase 구성 파일을 가져오세요.
-
Firebase JS SDK
- 터미널 창
복사 npm install firebase
- 터미널 창
-
Capacitor
- 기존 Capacitor 애플리케이션
- Capacitor Social Login 플러그인 설치:
터미널 창 npm install @capgo/capacitor-social-loginnpx cap sync
예제 애플리케이션
제목이 '예제 애플리케이션'인 섹션완전한 작동 예제는 저장소에 있습니다:
Code 저장소: code 저장소에서 찾을 수 있습니다
예제 앱은 다음을 보여줍니다:
- Firebase에서 이메일/패스워드 인증
- Google Sign-In 통합 (Android, iOS, Web)
- A simple key-value store using Firebase Firestore collections
- User-specific data storage in Firestore subcollections
A word about using the Firebase SDK on Capacitor
Section titled “A word about using the Firebase SDK on Capacitor”A word about using the Firebase SDK on Capacitor
Firebase __CAPGO_KEEP_0__를 __CAPGO_KEEP_1__에서 사용하는 것에 대해 말해 보겠습니다. getAuth Section titled “A word about using the Firebase __CAPGO_KEEP_0__ on __CAPGO_KEEP_1__”
import { initializeApp } from 'firebase/app';import { getAuth } from 'firebase/auth';
const app = initializeApp(firebaseConfig);const auth = getAuth(app);When using the Firebase JS Capacitor on __CAPGO_KEEP_1__, you need to be aware that when using the authentication methods, you need to initialize the Firebase Auth instance a bit differently. Firebase JS __CAPGO_KEEP_0__를 __CAPGO_KEEP_1__에서 사용할 때, 인증 방법을 사용할 때 Firebase Auth 인스턴스를 초기화하는 방법이 약간 다릅니다.On the web platform, you would use the initializeAuth 웹 플랫폼에서 사용할 때는 이 함수를 사용합니다. (function을 사용합니다.)
import { initializeApp } from 'firebase/app';import { initializeAuth } from 'firebase/auth';
const app = initializeApp(firebaseConfig);
function whichAuth() { let auth; if (Capacitor.isNativePlatform()) { auth = initializeAuth(app, { persistence: indexedDBLocalPersistence, }); } else { auth = getAuth(app); } return auth;}
export const auth = whichAuth();다음 단계
다음 단계설정 가이드를 계속 진행하세요:
Firebase 통합 소개에서 계속
Firebase 통합 소개에서 계속Firebase 통합을 사용 중이라면 Firebase 통합 Firebase 통합을 사용하여 인증 및 계정 흐름을 계획하고 Using @capgo/capacitor-social-login Using @capgo/capacitor-social-login @capgo/capacitor-social-login @capgo/capacitor-social-login @capgo/capacitor-passkey @capgo/capacitor-passkey @capgo/capacitor-native-biometric capgo/capacitor-native-생체인식 구현 세부 사항에 대해 두 단계 인증 __CAPGO_KEEP_0__/__CAPGO_KEEP_1__-native-생체인식 구현 세부 사항에 대해