1.2. Android SDK Installation
...
코드 블럭 |
---|
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
// Required 3.1.2 or later
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'httphttps://devrepo.kakao.com:8088/nexus/content/groups/public/'
name 'kakao'
}
maven {
url 'https://s3.ap-northeast-2.amazonaws.com/kakao-sdk-release/release/'
name 'Kakaogames'
}
}
} |
...
Optionally set the necessary modules in the build.gradle file of the application as shown below.
Developers who can not use 'implementation' using gradle version earlier than 3.0 can use 'compile'.
(Note) From 3.10.11, it has been changed from com.kakaogame to com.kakaogame.publishing. When upgrading from 3.10.11 or lower to 3.10.11 or higher, please modify it.
코드 블럭 |
---|
android {
...
// Required to use the feature of Java 8
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
...
dependencies {
// Required for games that use device authentication.
implementation "com.kakaogame:idp_device:$KAKAO_GAME_SDK_VERSION"
// Required for games that use Facebook authentication.
implementation "com.kakaogame:idp_facebook:$KAKAO_GAME_SDK_VERSION"
// Required for games that use Google game authentication.
implementation "com.kakaogame:idp_googlegame:$KAKAO_GAME_SDK_VERSION"
// Required for games that use Kakao authentication.
implementation "com.kakaogame:idp_kakao:$KAKAO_GAME_SDK_VERSION"
// Required for games that use Apple authentication.
implementation "com.kakaogame:idp_siwa:$KAKAO_GAME_SDK_VERSION"
// Required to use the features of the Kakao game SDK.
implementation "com.kakaogame.publishing:gamesdk:$KAKAO_GAME_SDK_VERSION"
}
apply plugin: 'com.google.gms.google-services' // Google Services plugin |
...
Each required library has a dependency in the following versions. Included automatically when linking the Kakao Game SDK.
SDK version | Module | External Libraries |
---|
3.7.1 | gamesdk | com.google.android.gms:play-services : 11.8.0 com.google.firebase:firebase-messaging:11.8.0 com.nostra13.universalimageloader:universal-image-loader:1.9.5
|
idp_kakao | |
idp_facebook | |
idp_googlegame | |
3.8.0 | gamesdk | com.google.android.gms:play-services-ads : 15.0.1 com.google.firebase:firebase-messaging:15.0.2 com.nostra13.universalimageloader:universal-image-loader:1.9.5
|
idp_kakao | |
idp_facebook | |
idp_googlegame | |
3.9.1 | gamesdk | com.google.android.gms:play-services-ads : 15.0.1 com.google.firebase:firebase-messaging:15.0.2 com.nostra13.universalimageloader:universal-image-loader:1.9.5
|
idp_kakao | |
idp_facebook | |
idp_googlegame | |
3.10.0 | gamesdk | |
idp_kakao | |
idp_facebook | |
idp_googlegame | |
3.10.4(AndroidX) | gamesdk | com.google.android.gms:play-services-ads : 18.0.0 com.nostra13.universalimageloader:universal-image-loader:1.9.5 androidx.legacy:legacy-support-v4:1.0.0 androidx.cardview:cardview:1.0.0 androidx.appcompat:appcompat:1.0.0
|
idp_facebook | |
idp_googlegame | com.google.android.gms:play-services-auth: 17.0.0 com.google.android.gms:play-services-games : 18.0.0 androidx.annotation:annotation:1.0.0
|
3.10.6 | gamesdk | com.google.android.gms:play-services-ads : 18.0.0 com.nostra13.universalimageloader:universal-image-loader:1.9.5 androidx.legacy:legacy-support-v4:1.0.0 androidx.cardview:cardview:1.0.0 androidx.appcompat:appcompat:1.0.0 com.android.installreferrer:installreferrer:1.0
|
idp_facebook | |
idp_googlegame | com.google.android.gms:play-services-auth: 17.0.0 com.google.android.gms:play-services-games : 18.0.0 androidx.annotation:annotation:1.0.0
|
3.11.0 | idp_facebook | |
3.11.5 | common | com.google.android.gms:play-services-ads:19.3.0 androidx.legacy:legacy-support-v4:1.0.0 com.nostra13.universalimageloader:universal-image-loader:1.9.5
|
gamesdk | com.android.installreferrer:installreferrer:1.0 androidx.appcompat:appcompat:1.0.0 androidx.cardview:cardview:1.0.0
|
idp_kakao | com.kakao.sdk:v2-partner-common:2.5.2 com.kakao.sdk:v2-partner-user:2.5.2 com.kakao.sdk:v2-partner-talk:2.5.2 com.kakao.sdk:v2-story:2.5.2 com.kakao.sdk:v2-link:2.5.2
|
idp_facebook | |
idp_googlegame | com.google.android.gms:play-services-auth:17.0.0 com.google.android.gms:play-services-games:18.0.0 androidx.annotation:annotation:1.0.0
|
3.13.4 | common | com.google.android.gms:play-services-ads:19.8.0 androidx.work:work-runtime:2.7.0 androidx.legacy:legacy-support-v4:1.0.0 com.nostra13.universalimageloader:universal-image-loader:1.9.5
|
gamesdk | com.android.installreferrer:installreferrer:1.0 androidx.appcompat:appcompat:1.0.0 androidx.cardview:cardview:1.0.0
|
idp_kakao | com.kakao.sdk:v2-partner-common:2.8.6 com.kakao.sdk:v2-partner-user:2.8.6 com.kakao.sdk:v2-partner-talk:2.8.6 com.kakao.sdk:v2-partner-friend:2.8.6 com.kakao.sdk:v2-story:2.8.6 com.kakao.sdk:v2-link:2.8.6
|
idp_facebook | |
idp_googlegame | com.google.android.gms:play-services-auth:19.2.0 com.google.android.gms:play-services-games:21.0.0 androidx.annotation:annotation:1.0.0
|
If your game uses an external library that overlaps dependencies with the above libraries, you can remove the link and use it with the higher version as shown below.
...
Create 'kakao_game_sdk_configuration.xml' in the 'src / main / assets' directory of the application and open the file with the editor to add the information.
Key | Required | Description | Example |
---|
appId | O | Issued App ID You can check it in 3.0 Admin -> Game Build -> Client Version Control. | 103815 |
appSecret | O | This is the same as the Native App Key, which can be found in Kakao Partner Center> Game Management> Select App> Game Details. | 951b75bf17fe0885ab5106ba2a9f9bc9 |
appVersion | O | App version (The Unity, PlayerSettings, and Version values are used as they are.) | 1.0.0 |
market | O | Setup a market for Android deployments.( "googlePlay", "oneStore", "kakaogameShop") | googlePlay kakaogameShop oneStore |
debugLevel | X | Log level of the Kakao Game SDK. ("Verbose", "Debug", "Error", "None") | None |
serverType | X | Server type. ("real" / "real_global" : Use if needed to access global server) | real |
assets/kakao_game_sdk_configuration.xml
...
res/values/kakao_sdk_idp_kakao.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> |
|
1.2.3.2. Facebook Authentication Detail Configuration
...
res/values/kakao_sdk_idp_facebook.xml
코드 블럭 |
---|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="facebook_app_id">[FACEBOOK_APP_ID]</string>
<string name="facebook_client_token">[FACEBOOK_CLIENT_TOKEN]</string>
<!--
For Facebook authentication, if "public_profile" and "email"
permissions are defined as default and additional Read permissions are required,
add them to the item entry below.
The Publish permission cannot be added.
-->
<string-array name="facebook_read_pemissions">
<item></item>
</string-array>
</resources> |
|
1.2.3.3. Google Authentication Detail Configuration
...
res/values/kakao_sdk_idp_google.xml
코드 블럭 |
---|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Set under KakaoGameSDK 3.5.0 -->
<string name="google_app_id">[GOOGLE_APP_ID]</string>
<string name="google_web_app_client_id">[GOOGLE_WEB_CLIENT_ID]</string>
<!-- Set in KakaoGameSDK 3.5.0 or later -->
<string name="kg_google_app_id">[GOOGLE_APP_ID]</string>
<string name="kg_google_web_app_client_id">[GOOGLE_WEB_CLIENT_ID]</string>
</resources> |
|
1.2.3.4. SigninWithApple Authentication Detail Configuration (3.10.6 and later)
...
res/values/kakao_sdk_idp_siwa.xml
코드 블럭 |
---|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="siwa_client_id">[SIWA_CLIENT_ID]</string>
</resources> |
|
1.2.4. AndroidManifest.xml File Configuration
...
Set the lowest version of SDK supported to 21.
Set the SDK target version to 31.
The SDK uses the following common permissions:
Add settings for Multi-window
In order to respond to split-screen and foldable phones of Android phones, add the following to the application tag.
Add the following to Activity tag.
The following activities must be configured for IDP authentication:
Add Google configuration to get ADID (affected version: 3.10.4 or later)
If there is no setting in the latest version of Google Ads, there is an issue where the app does not work.
If your game uses AdMob, insert the game's AdMob App Id in the appropriate field.
Need to declare the permission
AndroidManifest.xml (Common setting)
코드 블럭 |
---|
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- KakaoGame SDK START -->
<uses-sdk
android:minSdkVersion="21"
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">
<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>
...
</activity>
<!-- Add Google configuration to get ADID (affected version: 3.10.4 or later) -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~1234567890"/>
<!-- KakaoGame SDK Auth START -->
<activity
android:name="com.kakaogame.KGAuthActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!-- KakaoGame SDK Auth END-->
</application>
</manifest> |
|
1.2.4.2. URL Promotion Configuration
...
AndroidManifest.xml (URL Promotion setting)
코드 블럭 |
---|
<application>
<activity android:name=".MainActivity">
...
<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[APP_ID]" />
</intent-filter>
...
</application> |
|
1.2.4.3. Initial Event Configuration
When using version 3.10.6 or later, the INSTALL_REFERRER setting below is not done by the manifest.
Developers upgrading to version 3.10.6 using a lower version should delete the following setting.
Set the initial declaration of the Install Referrer Receiver.
...
AndroidManifest.xml (Set invitation events)
코드 블럭 |
---|
<application>
<!-- The INSTALL_REFERRER action must be declared first among the defined broadcast receivers -->
<receiver android:name="com.kakaogame.invite.KGMultipleInstallReferrerReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
...
<!-- If you are interlocking with an Apps Flyer -->
<receiver android:name="com.appsflyer.SingleInstallBroadcastReceiver"android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<!-- If you have a different ad platform, add a broadcast receiver below -->
</application> |
|
1.2.4.3.2. Single broadcast receiver
...
AndroidManifest.xml (Set invitation events)
코드 블럭 |
---|
<application>
<!-- If you are interlocking with an Apps Flyer -->
<receiver android:name="com.appsflyer.MultipleInstallBroadcastReceiver""android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<receiver android:name="com.kakaogame.invite.KGSingleInstallReferrerReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
</application> |
|
1.2.4.4. Kakao Authentication Configuration
...
AndroidManifest.xml (Kakao Authentication Settings)
코드 블럭 |
---|
<?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”>
<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>
<activity android:name="com.kakao.sdk.partner.auth.AgeAuthActivity"
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="ageauth" android:scheme="@string/kakao_scheme" />
</intent-filter>
</activity>
</application>
</manifest> |
|
1.2.4.5. Google Authentication Configuration
...
AndroidManifest.xml (Google Authentication Settings)
코드 블럭 |
---|
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/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.6. Facebook Authentication Configuration
...
AndroidManifest.xml (Facebook Authentication Settings)
코드 블럭 |
---|
<?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.7. Kakao Gameshop Settings
When using version 3.11.0 or later, you should delete the following setting.
The KakaoPaymentActivity/KakaoPaymentListActivity/ResultOfBankaActivity declaration should be added.
AndroidManifest.xml (Kakao Gameshop setting)
코드 블럭 |
---|
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<application>
<!-- Kakao GameShop Start -->
<activity
android:name="com.kakao.gameshop.sdk.KakaoPaymentActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="com.kakao.gameshop.sdk.KakaoPaymentListActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
<activity
android:name="com.kakao.gameshop.sdk.ResultOfBankaActivity"
android:launchMode="singleTask" >
<intent-filter>
<data
android:host="success_order"
android:scheme="kakaogameshop20150801" />
<data
android:host="cancel_order"
android:scheme="kakaogameshop20150801" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Kakao GameShop End -->
</application>
</manifest> |
|
1.2.4.8. Declaring queries elements for package visibility
...
If it is less than a specific version, you must add a query to use App2App login or third-party app features.
AndroidManifest.xml
코드 블럭 |
---|
<queries>
<!-- For App2App login(under 3.11.0) -->
<package android:name="com.kakao.talk />
<package android:name="com.kakao.onetalk />
<!-- End of App2App login -->
<!-- For browser content(under 3.11.3) -->
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<!-- End of browser content -->
<!-- For E-mail content(under 3.11.5) -->
<intent>
<action android:name="android.intent.action.SENDTO"/>
<data android:scheme="*" />
</intent>
<!-- End of E-mail content -->
</queries> |
|
1.2.4.9. Permission Settings
...
AndroidManifest.xml (Permission Popup Setting)
코드 블럭 |
---|
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<application>
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
</application>
</manifest> |
|
1.2.4.10. Setting Enable Http
...
Once the Android SDK is installed, the development certificate is saved in the 'debug.keystore' file as an alias for 'androiddebugkey'. Use the method provided below to check the certificate. (Note: The following cannot be used to find the actual key hash.)
keytool -exportcert -alias androiddebugkey -keystore {debug_keystore_path} -storepass android -keypass android |
---|
The key has that will be registered in the keystore must be found using the following method
...
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 |
---|
This method is guaranteed to work properly under Linux, but it may not get the correct value in the Windows environment.
If you get a key hash error, try the following:
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 and Linux : Can be checked at Eclipse "ADT > Preferences > Android > Build > Default debug keystore".
(Ex : ~/.android/debug.keystore)
...
1.2.5.2. Finding the release key hash
keytool -exportcert -alias [release_key_alias] -keystore [release_keystore_path] | openssl sha1 -binary | openssl base64 |
---|
Check for invalid android_key_hash error
If you receive a <com.kakao.util.exception.KakaoException: AUTHORIZATION_FAILED: invalid android_key_hash or ios_bundle_id or web_site_url> error after you have obtained a key hash and registered it in the Game Center, you can check whether you are using the correct key hash as shown below.
Temporarily change the onCreate () in the MainActivity class used by the game to:
...