버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.
목차

...

minLevel1
maxLevel6
outlinefalse
stylenone
typelist
printabletrue

...

1. Installation Environment

  • IDE: Android Studio

  • JDK: JDK 8이상8 or higher

  • Android SDK: Android 14 (API 34)

  • OS : Android 6.0, API 23 이상 지원 API 23 or higher

  • Use Gradle Version 6.1.1 사용

...

2.

...

 SDK

...

Environment Setup

2.1. build.gradle(project level)

코드 블럭
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        // 최소 Requires at least version 3.1.2
버전 이상 필요
        classpath 'com.google.gms:google-services:4.3.3'
     }
}
  
allprojects {
    repositories {
        google()
 // Performance Monitoring 을 위한 설정         classpath 'com.google.firebase:perf-plugin:1.2.0'          // Add themavenCentral()
Crashlytics Gradle plugin.      
        maven {
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
    }
}
  
allprojects {
    repositories {
        google()
        mavenCentral()
        
        maven            url 'https://devrepo.kakao.com/nexus/content/groups/public/'
            name 'kakao'
        }
        maven {
            url 'https://devrepo.kakao.com/nexus/content/groups/public/'
            name 'kakao'
        }
        maven {
            url 'https://s3.ap-northeast-2.amazonaws.com/kakao-sdk-release/release/'
            name 'Kakaogames'
        }
    }
}

...

2.2.

...

gradle.properties

코드 블럭
# Project-wide Gradle settings.
org.gradle.jvmargs=-Xmx4608M
KAKAO_GAME_SDK_VERSION=4.0.0
  
# 아래 2개Add 설정 추가the following two settings
android.useAndroidX=true
android.enableJetifier=true

...

2.

...

3. build.gradle(app level)

적용한 application 의 In the build.gradle 파일에 아래와 같이 필요한 모듈을 선택적으로 설정합니다.
gradle 3.0 미만 버전을 사용하여 'implementation' 을 사용할 수 없는 개발사에서는 'compile'을 사용하시면 됩니다.file of the applied application, selectively configure the necessary modules as shown below.

코드 블럭
apply plugin: 'com.android.application'
 
android {
    ...
  
    // JavaRequired 8to 언어use 기능을Java 사용하기8 위해language 필요features
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
...
// ----- Firebase 를 사용하기 위한 설정 추가 시작 -----
// Crashlytics 을 사용하기 위한 설정
apply plugin: 'com.google.firebase.crashlytics'
// Performance Monitoring 을 위한 설정
apply plugin: 'com.google.firebase.firebase-perf'
// ----- Firebase 를 사용하기 위한 설정 추가 끝 -----
...
  
dependencies {
    // 게스트 인증을 사용하는 게임에서 필요  
dependencies {
    // Required for games using guest authentication.
    implementation "com.kakaogame.publishing:idp_device:$KAKAO_GAME_SDK_VERSION"
 
    // Required for games using Kakao authentication.
    implementation "com.kakaogame.publishing:idp_kakao:$KAKAO_GAME_SDK_VERSION"
 
    // Required for games using Apple authentication.
    implementation "com.kakaogame.publishing:idp_devicesiwa:$KAKAO_GAME_SDK_VERSION"
 
    // 페이스북Required 인증을to 사용하는use 게임에서the 필요.main features of the  implementation "com.kakaogame.publishing:idp_facebook:$KAKAO_GAME_SDK_VERSION"
 
    // 구글게임 인증을 사용하는 게임에서 필요Game SDK.
    implementation "com.kakaogame.publishing:idp_googlegamegamesdk:$KAKAO_GAME_SDK_VERSION"
}
  
apply plugin: 'com.google.gms.google-services'  // 카카오Google 인증을Services 사용하는 게임에서 필요.
    implementation "com.kakaogame.publishing:idp_kakao:$KAKAO_GAME_SDK_VERSION"
 
    // 애플 인증을 사용하는 게임에서 필요.
    implementation "com.kakaogame.publishing:idp_siwa:$KAKAO_GAME_SDK_VERSION"
     
    // 트위터 인증을 사용하는 게임에서 필요.
    implementation "com.kakaogame.publishing:idp_twitter:$KAKAO_GAME_SDK_VERSION"
 
    // 게임SDK의 주요 기능을 사용하기 위해서 필요.
    implementation "com.kakaogame.publishing:gamesdk:$KAKAO_GAME_SDK_VERSION"
    
    // Firebase FCM(Push), Analytics, Crashlytics, Performance Monitoring 을 사용하는 게임에서 필요.
    implementation "com.kakaogame.publishing:firebase:$KAKAO_GAME_SDK_VERSION"
    
    // 웹상점 기능을 사용하기 위해서 필요
    implementation "com.kakaogame.publishing:kakaogame_addon:$KAKAO_GAME_SDK_VERSION"
    
    // 보안서비스 기능을 사용하기 위해서 필요
    implementation "com.kakaogame.publishing:security:$KAKAO_GAME_SDK_VERSION"
    
    // 결제 기능을 사용하기 위해서 필요
    implementation "com.kakaogame.publishing:payment:$KAKAO_GAME_SDK_VERSION"
}
  
apply plugin: 'com.google.gms.google-services'  // Google Services plugin

1.2.2.4. 외부 라이브러리 dependencies

각 필요한 라이브러리들이 아래 버전으로 dependency 가 걸려있습니다. 카카오 게임SDK를 연결 시 자동으로 포함됩니다.

...

SDK version

...

Module

...

External Libraries

...

4.0.1

...

gamesdk

...

plugin

2.4. External Library Dependencies

The necessary libraries are set as dependencies with the versions listed below. These are automatically included when connecting to the Kakao Game SDK.

1.2.3.4. SigninWithApple 인증 정보 설정

src/main/res/values/kakao_game_siwa_auth.xml 에 아래 리소스 파일 추가 및 value 설정합니다.

"SIWA클라이언트"값은 애플에서 발급 받은 값으로 변경 필요합니다.

res/values/kakao_game_siwa_auth.xml

...

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="siwa_client_id">[SIWA클라이언트아이디]</string>
</resources>

1.2.3.5. 트위터 인증 정보 설정

src/main/res/values/kakao_game_twitter_auth.xml 에 아래 리소스 파일 추가 및 value 설정합니다.

"Twitter Consumer Key", "Twitter Consumer Secret"값은 트위터에서 발급 받은 값으로 변경 필요합니다.

res/values/kakao_game_twitter_auth.xml

...

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="twitter_consumer_key">[Twitter Consumer Key]</string>
    <string name="twitter_consumer_secret">[Twitter Consumer Secret]</string>
</resources>

1.2.4. AndroidManifest.xml 파일 설정

게임 앱의 AndroidManifest.xml 파일에 아래 사항들을 설정하여야 합니다.

1.2.4.1. 공통 설정

  • SDK 최소 지원 버전은 23 이상으로 설정합니다

    • android:minSdkVersion="23"

  • SDK 타겟 버전을 31 으로 설정합니다.

    • android:exported 명시적 선언 추가

  • SDK 에서는 아래 퍼미션들을 공통으로 사용합니다

    • android.permission.INTERNET

    • android.permission.ACCESS_NETWORK_STATE

  • 다중 화면 처리를 위한 설정을 추가합니다.

    • 안드로이드 폰의 화면 분할 및 폴더블 폰에 대응하기 위해서 application 설정에 아래와 같이 추가합니다.

      • android:resizeableActivity="true"

    • 각 추가되는 Activity 설정에 아래와 같이 추가합니다.

      • android:configChanges="orientation|screenSize|keyboard|screenLayout|screenSize|smallestScreenSize"

  • API 23 이상에서는 앱이 일반 텍스트 HTTP와 같은 일반 텍스트 네트워크 트래픽을 사용하는지 여부를 설정할 수 있습니다.

    • android:usesCleartextTraffic="true"

  • URLScheme 추가

    • 아래와 같이 게임의 메인 Activity 에 intent filter 설정을 해주어야 합니다.

      scheme은 "kakaogame" + 앱아이디 로 구성 됩니다.(예를들어 앱ID가 123456이면 scheme 값은 "kakaogame123456" 이 됩니다.)

AndroidManifest.xml (공통 설정)

...

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- KakaoGame SDK START -->
<uses-sdk
    android:minSdkVersion="23"
    android:targetSdkVersion="31" />
<!-- KakaoGame SDK END -->
 
<!-- KakaoGame SDK START -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- KakaoGame SDK END -->
 
<application
    android:usesCleartextTraffic="true"
    android:resizeableActivity="true">
    <!-- MainActivity START : 퍼블리싱 가이드에만 포함됩니다: 시작 -->
    <activity android:name="com.companyname.MainActivity"
          android:configChanges="orientation|screenSize|keyboard|screenLayout|screenSize|smallestScreenSize"
          android:label="@string/app_name"
          android:launchMode="singleTask"
          android:screenOrientation="sensor"
          android:exported=”true” >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="kakaogame[앱아이디]" />
    </intent-filter>
    ...
    </activity>
    <!-- MainActivity END : 퍼블리싱 가이드에만 포함됩니다: 끝 -->
</application>
</manifest>

1.2.4.2. 카카오 인증 설정

  • 메인 Activity에 아래 intent filter 선언이 추가 되어야 합니다.

  • AuthCodeHandlerActivity 선언과 intent filter 선언이 필요합니다.

  • Android 12 대응하여 exported가 명시적으로 선언되어야 합니다.

AndroidManifest.xml (카카오 인증 설정)

코드 블럭 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" > <application> <activity android:name=".MainActivity" android:exported=”true”> <!-- Kakao Auth START --> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="@string/kakao_scheme" android:host="@string/kakaolink_host" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="@string/kakao_scheme" android:host="@string/kakaostory_host" /> </intent-filter> <!-- Kakao Auth END --> </activity> <activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity" android:exported=”true”>

SDK version

Module

External Libraries

4.0.1

gamesdk

com.google.android.gms:play-services-ads-identifier:18.0.0
androidx.appcompat:appcompat:1.3.1
androidx.legacy:legacy-support-v4:1.0.0
androidx.core:core-ktx:1.6.0
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0
androidx.databinding:viewbinding:7.0.4
com.google.android.play:review:2.0.0
com.google.android.play:app-update:2.0.0
com.android.installreferrer:installreferrer:2.2
com.github.bumptech.glide:glide:4.10.0
androidx.cardview:cardview:1.0.0

idp_kakao

com.kakao.sdk:{module}:2.13.0

idp_facebook

com.facebook.android:facebook-android-sdk:14.1.1

idp_googlegame

com.google.android.gms:play-services-auth:20.6.0
com.google.android.gms:play-services-games-v2:17.0.0
androidx.annotation:annotation:1.0.0

security

com.google.android.material:material:1.6.1

payment

com.android.billingclient:billing:6.0.1
androidx.recyclerview:recyclerview:1.0.0

4.4.0

gamesdk

com.google.android.gms:play-services-ads-identifier:18.0.0
androidx.appcompat:appcompat:1.6.1
androidx.legacy:legacy-support-v4:1.0.0
androidx.core:core-ktx:1.610.0
org.jetbrains.kotlin:kotlin-stdlib-jdk7jdk8:1.58.3110
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0
androidx.databinding:viewbinding:7.0.4
com.google.android.play:review:2.0.0
com.google.android.play:appreview-updatektx:2.0.0
com.google.android.installreferrerplay:installreferrerapp-update:2.0.0
com.google.android.play:app-update-ktx:2.0.0
com.android.installreferrer:installreferrer:2.2
com.github.bumptech.glide:glide:4.10.0
androidx.cardview:cardview:1.0.0

idp_kakao

com.kakao.sdk:{module}:2.1318.0

idp_facebook

com.facebook.android:facebook-android-sdk:14.1.1

idp_googlegame

com.google.android.gms:play-services-auth:20.6.0
com.google.android.gms:play-services-games-v2:17.0.0
androidx.annotation:annotation:1.0.0

security

com.google.android.material:material:1.6.1

payment

com.android.billingclient:billing:6.0.1
androidx.recyclerview:recyclerview:1.0.0

4.4.0

gamesdk

firebase

com.google.android.gmsfirebase:play-services-ads-identifier:18.0.0
androidx.appcompat:appcompat:1.6.1
androidx.legacy:legacy-support-v4:1.0.0
androidx.core:core-ktx:1.10.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0
androidx.databinding:viewbinding:7.0.4
com.google.android.play:review:2.0.0
com.google.android.play:review-ktx:2.0.0
com.google.android.play:app-update:2.0.0
com.google.android.play:app-update-ktx:2.0.0
com.android.installreferrer:installreferrer:2.2
com.github.bumptech.glide:glide:4.10.0
androidx.cardview:cardview:1.0.0

idp_kakao

com.kakao.sdk:{module}:2.18.0

idp_facebook

com.facebook.android:facebook-android-sdk:14.1.1

idp_googlegame

com.google.android.gms:play-services-auth:20.6.0
com.google.android.gms:play-services-games-v2:17.0.0
androidx.annotation:annotation:1.0.0

security

com.google.android.material:material:1.6.1

payment

com.android.billingclient:billing:6.0.1
androidx.recyclerview:recyclerview:1.0.0

firebase

com.google.firebase:firebase-bom:32.8.1
com.google.firebase:firebase-analytics
com.google.firebase:firebase-perf
com.google.firebase:firebase-crashlytics
com.google.firebase:firebase-messaging

 만약 게임에서 위 라이브러리와 dependencies가 겹치는 외부 라이브러리를 사용하는 경우 아래와 같이 해당 링크를 제거하여 버전이 높은 쪽으로 사용할 수 있습니다.

build.gradle(app level)

...

코드 블럭

dependencies {
    ...
    implementation ('com.kakaogame:gamesdk:{KAKAO_SDK_VERSION}') {
        exclude group: 'com.google.android.gms', module: 'play‐services-ads' // 제거하고자 하는 라이브러리
        exclude group: 'com.android.support' // 그룹 전체 라이브러리를 제거할 수도 있습니다. support 버전이 안 맞아 빌드 에러가 나는 경우 설정으로 변경 가능
        ...
    }
}

 아래는 페이스북 SDK 버전을 게임에서 원하는 SDK버전으로 변경하는 예시입니다.

build.gradle(app level)

...

코드 블럭

dependencies {
    ...
    implementation ('com.kakaogame:idp_facebook:{KAKAO_SDK_VERSION}') {
        exclude group: 'com.facebook.android', module: 'facebook-android-sdk'
    }
  
    implementation 'com.facebook.android:facebook-android-sdk:4.39.0'
}

Crashlytics를 사용하지 않는 개발사에서는 아래와 같이 제거하실 수 있습니다.

build.gradle(app level)

...

코드 블럭

dependencies {
    ...
    implementation ("com.kakaogame:firebase:$KAKAO_GAME_SDK_VERSION") {
        exclude group: 'com.crashlytics.sdk.android', module: 'crashlytics'
    }
}

1.2.3. IDP 인증 정보 설정

1.2.3.1. 카카오 인증 정보 설정

src/main/res/values/kakao_game_kakao_auth.xml 에 아래 리소스 파일 추가 및 value 설정합니다.

"카카오앱키"값은 발급 받은 값으로 변경이 필요합니다.

res/values/kakao_game_kakao_auth.xml

...

코드 블럭

<?xml version="1.0" encoding="UTF-8"?>
 
<resources>
    <string name="kakao_app_key">[카카오앱키]</string>
    <string name="kakao_scheme">kakao[카카오앱키]</string>
    <string name="kakaotalk_host">kakaotalk</string>
    <string name="kakaolink_host">kakaolink</string>
    <string name="kakaostory_host">kakaostory</string>
</resources>

1.2.3.2. 페이스북 인증 정보 설정

src/main/res/values/kakao_game_facebook_auth.xml 에 아래 리소스 파일 추가 및 value 설정합니다.

"페이스북앱키"값은 발급 받은 값으로 변경 필요합니다.

"페이스북 클라이언트 토큰"값은 ​https://kakaogames.atlassian.net/wiki/spaces/KS3GFP/pages/411861845/2.1#2.1.2.-%ED%8E%98%EC%9D%B4%EC%8A%A4%EB%B6%81-%EA%B0%9C%EB%B0%9C%EC%9E%90-%EC%84%BC%ED%84%B0(%ED%81%B4%EB%9D%BC%EC%9D%B4%EC%96%B8%ED%8A%B8-%ED%86%A0%ED%81%B0-%ED%99%95%EC%9D%B8)---SDK-3.15.0-%EC%9D%B4%EC%83%81-%EB%B2%84%EC%A0%84-%EC%A0%81%EC%9A%A9-%EC%8B%9C-%EC%84%A4%EC%A0%95-%ED%95%84%EC%9A%94 에서 확인하실 수 있습니다.

res/values/kakao_game_facebook_auth.xml

...

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="facebook_app_id">[페이스북앱키]</string>
    <string name="facebook_client_token">[페이스북 클라이언트 토큰]</string>
    <!--
    페이스북 인증시 "public_profile", "email" 퍼미션이 기본 정의되어 있으며
    추가로 필요한 Read 퍼미션이 있는 경우 아래 item 항목에 추가한다.
    Publish 퍼미션을 추가할 수 없다.
    -->
    <string-array name="facebook_read_pemissions">
        <item></item>
    </string-array>
</resources>

1.2.3.3. 구글 인증 정보 설정

src/main/res/values/kakao_game_google_auth.xml 에 아래 리소스 파일 추가 및 value 설정합니다.

"구글앱아이디"값과 "구글웹클라이언트아이디"값은 발급 받은 값으로 변경 필요합니다.

res/values/kakao_game_google_auth.xml

...

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
 
<resources>
    <string name="kg_google_app_id">[구글앱아이디]</string>
    <string name="kg_google_web_app_client_id">[구글웹클라이언트아이디]</string>
</resources>

firebase-bom:32.8.1
com.google.firebase:firebase-analytics
com.google.firebase:firebase-perf
com.google.firebase:firebase-crashlytics
com.google.firebase:firebase-messaging

 If the game uses external libraries that overlap with the above libraries and dependencies, you can remove the conflicting links as shown below and use the higher version.

build.gradle(app level)

코드 블럭

dependencies {
    ...
     implementation ('com.kakaogame:gamesdk:{KAKAO_SDK_VERSION}') {
        exclude group: 'com.google.android.gms', module: 'play-services-ads' // The library you want to remove
        exclude group: 'com.android.support' // You can also remove the entire group of libraries. This can be adjusted if there is a build error due to version mismatches in support libraries.
        ...
    }
}

 Below is an example of changing the Facebook SDK version to the desired version in the game.

build.gradle(app level)

코드 블럭

dependencies {
    ...
    implementation ('com.kakaogame:idp_facebook:{KAKAO_SDK_VERSION}') {
        exclude group: 'com.facebook.android', module: 'facebook-android-sdk'
    }
  
    implementation 'com.facebook.android:facebook-android-sdk:4.39.0'
}

If your development team does not use Crashlytics, you can remove it as shown below.

build.gradle(app level)

코드 블럭

dependencies {
    ...
    implementation ("com.kakaogame:firebase:$KAKAO_GAME_SDK_VERSION") {
        exclude group: 'com.crashlytics.sdk.android', module: 'crashlytics'
    }
}

3. IDP Authentication Information Setup

3.1. Kakao Authentication Information Setup

Add the following resource file and set the values in src/main/res/values/kakao_game_kakao_auth.xml.

The value for "Kakao App Key" needs to be replaced with the issued key.

res/values/kakao_game_kakao_auth.xml

코드 블럭

<?xml version="1.0" encoding="UTF-8"?>
 
<resources>
    <string name="kakao_app_key">[Kakao App Key]</string>
    <string name="kakao_scheme">kakao[Kakao App Key]</string>
    <string name="kakaotalk_host">kakaotalk</string>
    <string name="kakaolink_host">kakaolink</string>
    <string name="kakaostory_host">kakaostory</string>
</resources>

3.2. SigninWithApple Authentication Information Setup

Add the following resource file and set the values in src/main/res/values/kakao_game_siwa_auth.xml.

The value for "SIWA Client ID" needs to be replaced with the issued key from Apple.

res/values/kakao_game_siwa_auth.xml

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="siwa_client_id">[SIWA Client ID]</string>
</resources>

4. AndroidManifest.xml File Configuration

The AndroidManifest.xml file of the game app must be configured with the following settings.

4.1. Common Settings

  • Set the minimum supported SDK version to 23 or higher

    • android:minSdkVersion="23"

  • Set the SDK target version to 31.

    • Explicit declaration for android:exported is required.

  • The SDK commonly uses the following permissions

    • android.permission.INTERNET

    • android.permission.ACCESS_NETWORK_STATE

  • Add settings for handling multiple screens.

    • To support screen splitting on Android phones and foldable phones, add the following to the application settings.

      • android:resizeableActivity="true"

    • Add the following to each added Activity.

      • android:configChanges="orientation|screenSize|keyboard|screenLayout|screenSize|smallestScreenSize"

  • For API 23 and above, you can specify whether the app uses cleartext network traffic, such as plain text HTTP.

    • android:usesCleartextTraffic="true"

  • Add URLScheme

    • The main Activity of the game should include the following intent filter settings.

      The scheme is composed of "kakaogame" + the app ID. (For example, if the app ID is 123456, the scheme value will be "kakaogame123456")

AndroidManifest.xml (Common Settings)

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- KakaoGame SDK START -->
<uses-sdk
    android:minSdkVersion="23"
    android:targetSdkVersion="31" />
<!-- KakaoGame SDK END -->
 
<!-- KakaoGame SDK START -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- KakaoGame SDK END -->
 
<application
    android:usesCleartextTraffic="true"
    android:resizeableActivity="true">
    <!-- MainActivity START : Included only in the publishing guide: Start -->
    <activity android:name="com.companyname.MainActivity"
          android:configChanges="orientation|screenSize|keyboard|screenLayout|screenSize|smallestScreenSize"
          android:label="@string/app_name"
          android:launchMode="singleTask"
          android:screenOrientation="sensor"
          android:exported=”true” >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    <intent-filter>
    
<action android
    <action android:name="android.intent.action.VIEW"
 />
    
<category android
    <category android:name="android.intent.category.DEFAULT"
 />
    
<category android
    <category android:name="android.intent.category.BROWSABLE"
 />
    
<data android:host="oauth" android:scheme="@string/kakao_scheme" />
    <data android:scheme="kakaogame[App Id]" />
    </intent-filter>
    ...
    </activity>
  
</application> </manifest>

1.2.4.3. 구글 인증 설정

  • SignInHubActivity 선언이 추가 되어야 합니다.

  • com.google.android.gms.version/com.google.android.gms.games.APP_ID 메타 데이터 선언이 추가 되어야 합니다.

  • APP_ID에 숫자를 하드코딩하면 인증에 실패합니다. "@string/google_app_id" 형태로 작성하셔야 합니다.

...

  <!-- MainActivity END : Included only in the publishing guide: End -->
</application>
</manifest>

4.2. Kakao Authentication Configuration

  • The main Activity must include the following intent filter declaration.

  • You need to declare AuthCodeHandlerActivity and add its intent filter.

  • For Android 12, the exported attribute must be explicitly declared.

AndroidManifest.xml (Kakao Authentication Configuration)

코드 블럭

<?
xml version
xml version="1.0"
 encoding
 encoding="utf-8"?>
<manifest 
<manifest xmlns
xmlns:android="http://schemas.android.com/apk/res/android" >
<application>
    <activity android
" >   <application> <!-- Google Auth START --> <activity     android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"     android:theme="@android:style/Theme.Translucent.NoTitleBar" /> <meta-data     android:name="com.google.android.gms.version"     android:value="@integer/google_play_services_version" /> <meta-data     android:name="com.google.android.gms.games.APP_ID"     android:value="@string/google_app_id" /> <!-- Google Auth END --> </application> </manifest>

1.2.4.4. 페이스북 인증 설정

  • FacebookActivity 선언이 추가 되어야 합니다.

  • com.facebook.sdk.ApplicationId 메타 데이터 선언이 추가 되어야 합니다.

  • com.facebook.sdk.ClientToken 메타 데이터 선언이 추가 되어야 합니다.

AndroidManifest.xml (페이스북 인증 설정)

...

코드 블럭

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<application>
<!-- Facebook Auth START -->
<activity
    android:name="com.facebook.FacebookActivity"
    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Translucent.NoTitleBar" />
 
<meta-data
    android:name="com.facebook.sdk.ApplicationId"
    android:value="@string/facebook_app_id" />

<meta-data
    android:name="com.facebook.sdk.ClientToken"
    android:value="@string/facebook_client_token" />
<!-- Facebook Auth END -->
</application>
</manifest>

1.2.4.5. 트위터 인증 설정

  • TwitterOAuthActivity 선언이 추가 되어야 합니다.

AndroidManifest.xml (트위터 인증 설정)

코드 블럭 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" > <application> <!-- Twiitter Auth Start --> <activity android:name="com.kakaogame.twitter.TwitterOAuthActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" /> <!-- Twitter Auth End -->
:name=".MainActivity"
              android:exported=”true”>
        <!-- Kakao Auth START -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/kakao_scheme" android:host="@string/kakaolink_host" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/kakao_scheme" android:host="@string/kakaostory_host" />
        </intent-filter>
        <!-- Kakao Auth END -->
    </activity>
 
    <activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
              android:exported=”true”>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:host="oauth" android:scheme="@string/kakao_scheme" />
        </intent-filter>
    </activity>
</application>
</manifest>

...

4.

...

targetSdkVersion을 28 버전 이상으로 설정하고 http 통신을 사용하는 게임은 아래와 같은 설정이 필요합니다.

카카오 게임 SDK 내부에서는 http를 사용하지 않습니다. 개발사에서 cdn등 이슈로 http 콜이 필요한 경우에만 설정합니다.

http 콜이 필요한 도메인 설정

3. HTTP Usage Configuration

If targetSdkVersion is set to version 28 or higher and the game uses HTTP communication, the following configuration is necessary.

The Kakao Game SDK does not use HTTP internally. This setting is only needed if the developer requires HTTP calls for issues like CDN.

  • Setting the domain that requires HTTP calls

    • Create the res/xml/network_security_config.xml 파일 생성하여 http 통신이 필요한 domain을 추가file and add the domain that requires HTTP communication.

      network_security_config.xml

      코드 블럭
      <?xml version="1.0" encoding="utf-8"?>
      <network-security-config>
          <domain-config cleartextTrafficPermitted="true">
              <!-- Add Your Http Domain -->
              <domain includeSubdomains="true">example.com</domain>
          </domain-config>
      </network-security-config>
      

    • In the Application section of the AndroidManifest.xml 내 Application에 위에서 생성한 파일을 networkSecurityConfig 로 설정, set the file created above as networkSecurityConfig.

      AndroidManifest.xml

      코드 블럭
      <application
              android:networkSecurityConfig="@xml/network_security_config">
      

...

4.

...

4.

...

라이브러리에서 게임 내 지원 언어 외 추가적인 언어 팩이 있을 때, 해당 언어를 제거하고 싶다면 아래 위치의 폴더를 제거 해주시면 됩니다.

예를 들어, 일본어 언어 설정을 제거하고 싶을 때에는 KakaoGameSDK>res>values-ja 폴더를 제거합니다.

1.2.5. 키 해시 확인 및 등록 방법

  • 앱의 빌드를 위해서는 빌드 머신의 키 해시를 등록해야 하며 다음과 같은 방법으로 키 해시를 확인하실 수 있습니다.

  • 디버그 키 해시 및 릴리즈 키 해시를 아래 가이드대로 구해서 [게임센터 > 게임관리 > 키해시등록] 메뉴에 등록해주세요.

1.2.5.1. 디버그 키 해시 구하기

...

 Game Supported Language Resources

If there are additional language packs in the library that are not supported by the game, and you want to remove them, you can delete the corresponding folder at the location below.

For example, if you want to remove the Japanese language settings, delete the KakaoGameSDK>res>values-ja folder.

5. Key Hash Verification and Registration Method

  • To build the app, you need to register the key hash of the build machine, and you can check the key hash using the following method.

    Obtain the debug key hash and release key hash according to the guide below and register them in the [Game Center > Game Management > Key Hash Registration] menu.

5.1. Obtaining the Debug Key Hash

  • When you install the Android SDK, a development certificate is stored in the debug.keystore file under the alias androiddebugkey. The method to verify the certificate is as follows. (Note: This is not the actual method to obtain the key hash.)

    코드 블럭
    keytool -exportcert -alias androiddebugkey -keystore {debug_keystore_path} -storepass android -keypass android
    

    keystore 등록해야할 키 해시는 아래와 같이 수행하여 구해야 합니다.

  • 해당 샘플을 빌드한 머신에서 수행해야 합니다.

  • openssl 버전은

    The key hash that needs to be registered in the keystore should be obtained by performing the following command.

    • This must be executed on the machine where the sample was built.

    • Please use OpenSSL version 1.0.2 버전 혹은 그 이상것을 사용 해주시기 바랍니다or higher.

    코드 블럭
     keytool -exportcert -alias androiddebugkey -keystore {debug_keystore_path} -storepass android -keypass android | openssl sha1 -binary | openssl base64
    

    위 방법은 리눅스에서는 정상 동작을 보증하나, 윈도우즈 환경에서는 제대로 값을 얻지 못할 수도 있습니다.

  • 키 해시 오류가 날 경우, 아래의 방법으로도 시도해보시기 바랍니다

    The above method is guaranteed to work on Linux, but may not provide correct values in a Windows environment.

    • If you encounter key hash errors, try the following method as well.

    코드 블럭
    keytool -exportcert -alias androiddebugkey -keystore {debug_keystore_path} > ./debug.txt
    openssl sha1 -binary debug.txt > debug_sha.txt
    openssl base64 -in debug_sha.txt > debug_base64.txt
    

[debug_keystore_path]

  • OS X와 리눅스 : X and Linux: You can check it under Eclipse "ADT > Preferences > Android > Build > Default debug keystore" 에서 확인 가능합니다.  
    (예 : (e.g., ~/.android/debug.keystore)

  • Windows: You can check it under Eclipse "Window > Preferences > Android > Build > Default debug keystore" 에서 확인 가능합니다.

  • Windows Vista와 Vista and Windows 7 (예: : (e.g., C:\Users\.android\debug.keystore)

  • Windows XP (예 : : (e.g., C:\Documents and Settings\.android\debug.keystore)

  • keytool : $JAVA_HOME/bin 아래에 존재합니다.

  • openssl : Windows의 경우는 다운 받아 설치합니다.

...

  • is located under $JAVA_HOME/bin.

  • For Windows, you will need to download and install OpenSSL.

5.2. Obtaining the Release Key Hash

코드 블럭
keytool -exportcert -alias [release_key_alias] -keystore [release_keystore_path] | openssl sha1 -binary | openssl base64

...

  • Checking for invalid android_key_hash 오류 확인

    키 해시를 구하여 게임센터에 등록한 후에도 지속적으로

    Errors

    • If you continue to receive <com.kakao.util.exception.KakaoException: AUTHORIZATION_FAILED : invalid android_key_hash or ios_bundle_id or web_site_url> 오류를 받는다면 아래와 같이 정상적인 키 해시를 사용하고 있는지 확인하실 수 있습니다. 
      게임에서 사용하는 MainActivity 클래스에서 onCreate()를 임시로 아래와 같이 변경합니다errors after registering the key hash in the Game Center, you can verify whether you are using the correct key hash as follows:

    • Temporarily modify the onCreate() method in the MainActivity class in the game as follows.

    • MainActivity

      코드 블럭
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
           
          // Add code to print out the key hash
          try {
                  android.content.pm.Signature[] signatures;
                  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
                      PackageInfo packageInfo = getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNING_CERTIFICATES);
                      if (packageInfo == null
                              || packageInfo.signingInfo == null) {
                          Log.e("KeyHash:", "KeyHash is Null. ");
                      }
                      if(packageInfo.signingInfo.hasMultipleSigners()){
                          signatures = packageInfo.signingInfo.getApkContentsSigners();
                      } else {
                          signatures = packageInfo.signingInfo.getSigningCertificateHistory();
                      }
                  } else {
                      PackageInfo info = getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
                      signatures = info.signatures;
                  }
      
                  for (android.content.pm.Signature signature : signatures) {
                      MessageDigest md = MessageDigest.getInstance("SHA");
                      md.update(signature.toByteArray());
                      Log.e("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
                  }
              } catch (PackageManager.NameNotFoundException e) {
                  e.printStackTrace();
              } catch (NoSuchAlgorithmException e) {
                  e.printStackTrace();
              }
      }
      

      위 코드를 실행시켜 Logcat 출력에 다음과 같이 표시된 메시지에서 키 해시를 확인합니다.

1.2.6. 빌드 확인

프로젝트가 정상적으로 빌드 되는지 확인합니다.

    • Run the above code and check the key hash from the message displayed in the Logcat output as follows.

6. Build Verification

Verify that the project builds successfully.