Dev_Dylan

[iOS]Google Login 스키마 추가(with error) 본문

iOS/Solve_ERROR

[iOS]Google Login 스키마 추가(with error)

Dylan_21 2024. 3. 8. 16:16

 

스키마 추가하는데 오류나서 쓰는 글

 

URL Schemes Info.plist에 추가하는 방법 (첫번째 방법)

 

Google Login

https://developers.google.com/identity/sign-in/ios/start-integrating?hl=ko

 

iOS 및 macOS용 Google 로그인 시작하기  |  Authentication  |  Google for Developers

이 페이지는 Cloud Translation API를 통해 번역되었습니다. 의견 보내기 iOS 및 macOS용 Google 로그인 시작하기 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. iOS 또

developers.google.com

위 문서대로 Info.plist에 

<key>GIDClientID</key>
<string>YOUR_IOS_CLIENT_ID</string>
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>YOUR_DOT_REVERSED_IOS_CLIENT_ID</string>
    </array>
  </dict>
</array>

위와 같은 코드를 넣어주면 됨

 

발급 받는 키 (YOUR_IOS_CLIENT_ID)

1234567890-abcdefg.apps.googleusercontent.com

 

URL Schemes에 들어갈 키 (YOUR_DOT_REVERSED_IOS_CLIENT_ID)

com.googleusercontent.apps.1234567890-abcdefg

-> 점 기준으로 역방향임

 

 

간단하게

info plist에 들어가서

<plist version="1.0">
<dict>
	<key>GIDClientID</key>
	<string>1234567890-abcdefg.apps.googleusercontent.com</string>
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>com.googleusercontent.apps.1234567890-abcdefg</string>
			</array>
		</dict>
	</array>

 

상단 <dict> 밑에 바로 넣어주어도 된다.

 

 

 

 

Target에 들어가서 입력방법 (두번째 방법)

 

프로젝트 - Target - Info - URL Types

 

 

 

여기까지만 하면 아래 오류가 나옴

"Your app is missing support for the following URL schemes: your_ios_client_id"

 

스킴 덜 추가되어서 에러남.

 

Info 에 들어가서 GIDClientID 추가해준다.

key 값에 발급받은 키 <YOUR_IOS_CLIENT_ID> 입력

 

 

 

 

 

Comments