Firebase Google 로그인 iOS
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 명령어를 복사하세요.
이 가이드는 iOS에서 Google Sign-In을 Firebase Authentication과 통합하는 데 도움이 될 것입니다. iOS에서 Google Sign-In을 Firebase Authentication과 통합하는 데 도움이 될 것입니다. __CAPGO_KEEP_0__ 설정.
설정 단계
설정 단계-
프로젝트 개요로 이동하세요. console.cloud.google.com
-
버튼을 클릭하세요.
Add appFirebase 앱 추가 버튼
-
선택
iOS
-
폼의 첫 번째 부분을 채우세요
- Fill the
Apple bundle ID- Xcode에서 앱을 사용하는
npx cap open ios - Double click on
App
- 앱이 올바르게 설정되어 있는지 확인하세요
Targets -> App
- Find your
Bundle Identifier
- 복사하고
Bundle IdentifierFirebase 콘솔에 붙여 넣으세요
- Xcode에서 앱을 사용하는
- 버튼을 클릭하세요
Register app버튼을 클릭하세요
- Fill the
-
Firebase Skip
Download config file단계
-
Firebase Skip
Add firebase SDK단계
-
Firebase Skip
Add initialization code단계
-
__CAPGO_KEEP_0__ 버튼 클릭하기
Continue to console단계
-
iOS 클라이언트 ID와
YOUR_DOT_REVERSED_IOS_CLIENT_ID-
Google Cloud Console로 이동하세요. console.cloud.google.com
-
프로젝트 찾기
- 프로젝트 선택기
- Firebase 프로젝트 선택기 프로젝트
sociallogin-tutorial-app.
- 프로젝트 선택기
-
검색 바를 열어
credentials- Google Cloud Console 검색 바
- __CAPGO_KEEP_0__
credentials__CAPGO_KEEP_1__APIs and Services__CAPGO_KEEP_2__
- Google Cloud Console 검색 바
-
__CAPGO_KEEP_4__
iOS client for [YOUR_APP_ID] (auto created by Google Service)__CAPGO_KEEP_5__sociallogin-tutorial-app.
-
__CAPGO_KEEP_7__
Client ID__CAPGO_KEEP_8__iOS URL scheme__CAPGO_KEEP_9__iOSClientId__CAPGO_KEEP_10__YOUR_DOT_REVERSED_IOS_CLIENT_ID.
-
-
웹 클라이언트 ID를 가져오세요
- Firebase 콘솔로 돌아가서
Build->Authentication
- 버튼을 클릭하세요
Sign-in method__CAPGO_KEEP_0__
- Click on the
Googleprovider
- Click on the
Web SDK configurationbutton
- Copy the
Web client ID. 이 설정은 플러그인에 사용할webClientIdFirebase Authentication Sign-in Method Web __CAPGO_KEEP_0__ ConfigurationinitializeWeb Client ID
- Firebase 콘솔로 돌아가서
-
앱의 Info.plist을 수정하세요
-
Xcode를 열고 프로젝트 탐색기에서
Info.plist파일
-
이 파일을 오른쪽 클릭하고 소스 code로 열기
-
파일의 하단 부분에서
Plist파일에서</dict>태그
-
닫는 태그 바로 앞에 다음 구문을 삽입하세요
</dict>닫는 태그 바로 앞에 다음 구문을 삽입하세요
<key>CFBundleURLTypes</key><array><dict><key>CFBundleURLSchemes</key><array><string>YOUR_DOT_REVERSED_IOS_CLIENT_ID</string></array></dict></array><key>GIDClientID</key><string>YOUR_IOS_CLIENT_ID.apps.googleusercontent.com</string> -
변경
YOUR_DOT_REVERSED_IOS_CLIENT_ID9번 단계에서 복사한 iOS URL scheme으로 설정
-
-
변경
YOUR_IOS_CLIENT_ID9번 단계에서 복사한 iOS Client ID로 설정 -
__CAPGO_KEEP_0__ 파일을 저장하세요.
Command + S -
__CAPGO_KEEP_1__을 수정하세요.
AppDelegate.swift-
AppDelegate를 열어보세요.
-
__CAPGO_KEEP_2__을 삽입하세요.
import GoogleSignInAppDelegate.swift 파일의 맨 위에 __CAPGO_KEEP_3__을 추가하세요.
-
__CAPGO_KEEP_4__을 찾으세요.
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:])__CAPGO_KEEP_5__을 찾으세요.
-
__CAPGO_KEEP_6__을 수정하세요.
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {// Called when the app was launched with a url. Feel free to add additional processing here,// but if you want the App API to support tracking app url opens, make sure to keep this callvar handled: Boolhandled = GIDSignIn.sharedInstance.handle(url)if handled {return true}return ApplicationDelegateProxy.shared.application(app, open: url, options: options)}
-
__CAPGO_KEEP_0__으로 파일을 저장하세요.
Command + S
-
-
앱에서 Google 로그인을 사용하는 방법
이 단계에서는 앱에서 Google 로그인을 사용할 준비가 되었습니다. Google 로그인을 사용하려면 authUtils.ts 예제 앱의 인증을 위해 Google과 인증하는 파일입니다.
사용자가 Firebase Auth에 처음 로그인할 때 자동으로 사용자 계정이 생성됩니다.
문제 해결
제목이 “문제 해결”인 섹션인증이 지연되거나 실패하는 경우:
- Firebase 웹 클라이언트 ID와 일치하는지 확인하세요.
idTokenVerify the audience matches your Firebase web client ID - Google Sign-In이 Firebase Console에서 활성화되어 있는지 확인하세요.
- Info.plist에 올바른 URL schemes과 GIDClientID가 포함되어 있는지 확인하세요.
- Verify
iOSServerClientId웹 클라이언트 ID와 일치하는지 확인하세요. - 참고로 __CAPGO_KEEP_0__ 예제 앱을 확인하세요. example app code iOS Firebase Google Login에서 계속 진행하세요.
Firebase Google Login on iOS를 사용하여 인증 및 계정 흐름을 계획하고 있습니다.
Firebase Google Login on iOS와 연결하세요.Firebase Google Login on iOS와 연결하세요. Firebase Google Login on iOS와 연결하세요. Firebase Google Login on iOS와 연결하세요. @capgo/capacitor-social-login Using @capgo/capacitor-social-login @capgo/capacitor-social-login Using @capgo/capacitor-social-login @capgo/capacitor-passkey Using @capgo/capacitor-passkey @capgo/capacitor-native-biometric Using @capgo/capacitor-native-biometric Two-factor authentication Two-factor authentication