Google Play Games Service

Google Play Games Service updated_at: 2023-09-06 16:57

Google Play Games Services

만약 게임을 만들었다면 play games service로 달아 보는 것이...

Play Games Services setup

먼저 Google Play Console에서 Play Games Services를 활성화 하여야 한다.
현재 앱의 카테고리가 game으로 등록되어 있으면 좌측에 "Play Games Services"가 활성화 된다.
Play Games Services > Setup and management > Configuration
3 가지중 하나를 선택해야 하는데 신규 게임이고 아직 Google APIs가 활성화 되지 않아 으므로 중간을 클릭한다.

Play Games Services's Configuration

다음 페이지로 넘어가면 앞으로 설정해야 하는 것들이 리스트업된다.
이곳에 보면 Project ID가 나오는데 이 부분은 아래 capacitor와 연동하기 위해 필요한 부분이다.

 Set up Play Games Services

Create OAuth consent screen in Google Cloud Platform 을 클릭
여기서 Google Cloud Platform (GCP) 로 넘어가자

Configure your OAuth consent screen

APIs & Services

GCP 에서 우리는 기본적인 2가지를 세팅할 것이다.

OAuth consent screen

User Type

Create를 클릭 (자동으로 External이 설정된다.)

OAuth consent screen

OAuth consent screen

아래 붉은 색 4군데만 채우고 계속 클릭 클릭 하면 된다.

OAuth consent screen

Scopes

scopes 에서는 'auth/games', 'auth/games_lite', 'auth/drive.appdata' 세개를 선택한다. Scopes

Test users

Test users는 테스트용으로 google에 등록된 email을 입력하면 된다.

Credentials 설정

여기서는 OAuth 2.0 Client IDs 중 Android 부분만 설정할 예정이다.
CREATE CREDENTIALS 클릭

Credentials

OAuth client ID 선택

OAuth client ID 선택

Android 선택

Android 선택

아래폼을 입력하고 마무리 짓는다
참조로 본인의 경우 SHA-1 는 Android Studio에서 우측 Gradle 판넬 선택후 > android > app > Tasks > android > signingReport에서 가져왔다.

Credentials 세부 항목 입력

  • fingerprint를 획득할때 주의 점

    • keytool 의 버젼이 다를 수 있으므로 되도록 android studio에서 제공하는 keytool을 사용한다.
    • windows에서 작업할 경우 폴더의 공백을 인식할 수 었으므로 D:"Program Files"\Android"Android Studio"\jbr\bin\keytool 처럼 공백 폴더의 이름은 "" 으로 처리한다.
  • 테스트용 : 테스트용으로는 android stuio에서 직접 가져오는 것을 추천한다.

    테스트용 Fingerprint가져오기

  • 실서비스용 fingerprint를 획득할때는 Google Play Console > Setup > App signing 에 보면 "App signing key certificate" 에서 정의된 fingerprint를 사용하면 된다.

아래와 같이 설정된 모습을 확인할 수 있습니다.

Local path에 생성된 모습

여기서 또 중요한 점은 테스트를 하기위해서는 테스트용 "OAuth 2.0 Client IDs 를 하나더 만들고 위의 테스트용 fingerprint를 이용하여 세팅하여 주면 된다. 이후 Play Games Services setup 에서는 테스트용 및 실서비서용 중 실서비서용만 세팅하면 테스트용은 자동으로 된다. (실서비스용이 없다면 테스용을 세팅해 두자)

Play Games Services setup

Google Play Console로 돌아와서 Play Games Services 의 세팅을 마무리 하자.
Configuration > Credentials > Add credential 클릭

Credentials 세부 항목 입력

Android 를 선택하고 위에서 설정한 OAuth client를 선택하면 됩니다.

Credentials 세부 항목 입력

평점을 남겨주세요
평점 : 5.0
총 투표수 : 1