1.1. Unity SDK Installation
1.1. Unity SDK Installation
- 1 1.1. Unity SDK Installation
- 1.1 1.1.1. Installation and Runtime Environment
- 1.2 1.1.2. Configuring SDK Files
- 1.3 1.1.3. SDK Setup
- 1.3.1 1.1.3.1. SDK import
- 1.3.2 1.1.3.2. Migration
- 1.3.3 1.1.3.3. Open the Kakao Game SDK Settings Inspector
- 1.3.4 1.1.3.4. Set KakaoGame properties
- 1.3.5 1.1.3.5. Settings required when using the Kakao multi-app login function
- 1.3.6 1.1.3.6. Google information setting
- 1.3.7 1.1.3.7. Facebook information setting
- 1.3.8 1.1.3.8. Set up Signin with Apple information
- 1.3.9 1.1.3.9. Newtonsoft.Json Installation (SDK 3.15.0 or later)
- 1.4 1.1.4. Android Settings
- 1.5 1.1.5. iOS Settings
- 1.5.1 1.1.5.1. EDM Settings
- 1.6 1.1.6. Supported Language Resource in the Game
- 1.7 1.1.7. Unity Editor Login
- 1.8 1.1.8. Notes on Using the Unity SDK
1.1.1. Installation and Runtime Environment
Minimum version
Required: 2019.4.15f1 or later
Recommended
Unity 2020.3.43f1 or later
If you do not use the recommended version, you have the following problems.
Using a lower Unity version can cause a bug in which the web socket connection to the server from the editor environment is terminated.
App crashes during launch with "USING MEMORYADRESSES FROM MORE THAN 16GB OF MEMORY" messages. (related issues)
In Unity 2018.x version, there is a bug that only black screen appears when building Android 12 or higher.
1.1.2. Configuring SDK Files
The KakaoGameSDK_Unity_[version] .zip file consists of the following files:
File | Description |
---|---|
KakaoGameSDK.unitypackage |
|
SampleApp.zip |
|
ApiReference.zip |
|
1.1.3. SDK Setup
1.1.3.1. SDK import
Run the downloaded ‘.unitypackage’ file to display the menu for automatic import from the Unity window. Import with all items checked.
The Android and iOS Kakao Game SDKs are distributed as part of the Unity package. There is no need to download or set up a separate SDK for the platforms
1.1.3.2. Migration
Run the downloaded ‘.unitypackage’ file to display the menu for automatic import from the Unity window. Import with required items checked.
Compilation errors may be caused by previous versions of SDK files.
KGassetImporter automatically removes old SDK files when you click Assets > Reimport All or reboot the editor.
You can modify the SDK changes afterwards.
1.1.3.3. Open the Kakao Game SDK Settings Inspector
The Kakao menu is added to Unity’s top menu as shown in the following image if the SDK is successfully added.
Click the Configure SDK button in the menu to go to the SDK setup menu.
1.1.3.4. Set KakaoGame properties
Enter a valid value in each field of the setup screen using the following table as reference:
KakaoGame SDK Properties
Key | Type | Required | Description | Example |
---|---|---|---|---|
App Id | String | O | Issued App ID You can check it in Kakao Partner Center> Game Management> Select App> Game Details. | 103815 |
App Secret | String | 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 |
Debug Level | String | X | Log level of the Kakao Game SDK. ("Verbose", "Debug", "Error", "None") | None |
Set the Kakao game properties as follows.
Click the "Check Configuration setting" button to confirm that it is properly configured after configuration.
If the settings are not correct, the cause explanation will be displayed as shown below.
The following cases are caused by using an invalid app ID.
Check if the app ID delivered by PM is registered well. If it is registered well, please contact the PM.
1.1.3.5. Settings required when using the Kakao multi-app login function
From SDK 3.11.0 version, iOS supports Kakao multi-app login (Android can support with key hash as before).
Accordingly, build after clicking the Kakao MultiApp Login check box in the Unity Inspector for each game project in the game where you want to use multi-app login.
1.1.3.6. Google information setting
This explanation is applicable if Google IDP is used.
Activate the Google check button if Google IDP is used.
If you are authenticating with Google in iOS apps, set your iOS client ID.
If you want to use Google Apps authentication in your Android app, or if you want to use Google Apps authentication, set your Webapp Client ID.
If you want to request Google permission for additional Google authentication, add it as shown in the following example.
1.1.3.7. Facebook information setting
This explanation is applicable if Faebook IDP is used.
If you use Facebook authentication, click the Facebook check box.
Register your Facebook App Key.
Register your Facebook App Title. When the Facebook login window appears, it is the exposed title.
Register your Facebook Client Token.
Add additional permissions if needed for Facebook authentication.
If you click FB SDK Settings, you can check the Facebook Settings.assets generated by the Facebook SDK. You need to verify that the build was created correctly.
1.1.3.8. Set up Signin with Apple information
If you use Signin with Apple in your game, please set it up.
If you use Signin with Apple, click the SigninWithApple check box.
Enter the ClientId field issued by Apple Admin.
Additional settings related to signin with apple are required for each Unity version.
// KGPostBuild.cs
if (KGSharedData.instance.useSigninWithApple)
KGIosSupport.AddSigninWithAppleCapability(buildPath); |
If a build error occurs in the code above after adding your version of Unity, your version of Unity does not support adding signin with apple capabilities.
If that's the case, you'll first need to add signin with apple capabilities manually on the built Xcode project after building with the ios target.(Link : 1.3. iOS SDK Installation | 1.3.3.6. Set KakaoGame SDK Properties)
1.1.3.9. Newtonsoft.Json Installation (SDK 3.15.0 or later)
Since SDK 3.15.0 and later, newtonsoft-json is used for internal logic, and the package must be installed as a requirement.
Open Packages/manifest.json in the project root directory and add "com.unity.nuget.newtonsoft-json": "3.0.2".
{
"dependencies": {
//...
"com.unity.nuget.newtonsoft-json": "3.0.2"
}
}
1.1.4. Android Settings
1.1.4.1. Permission Setting
After import unitypackage, add the android permission to the following path Assets/Plugins/Android/AndroidManifest.xml
Add like this format "<uses-permission android:name="android.permission.XXXXXX" />"
1.1.4.2. Set google-services.json
Download the google-services.json file that matches your game settings. (See also How to download files from the Firebase console in 1.2. Android SDK Installation )
After downloading the file, place it under the Assets/Plugins/Android folder.
If you have Google-services related errors in your Windows environment (under SDK 3.15.0)
You can create google-services.xml or google-services-desktop.json using Assets/Firebase/Editor/generate_xml_from_google_services_json.exe or download from GitHub - firebase/firebase-cpp-sdk: Firebase C++ SDK
"generate_xml_from_google_services_json.exe" -i "{Original google-services.json Path}" -o "{Project Path}/Assets/Plugins/Android/KakaoGameSDK.androidlib/res/values/google-services.xml" -p "{Package Name}"
Alternatively, you can set Python CLI to environment variables after installation to enable Python to run. (Download Link : Download Python )
1.1.4.3. custom build files Setting
Go to Player → Publishing Settings → Build to set up your custom files.
The custom-build files below are required by the SDK.
AndroidManifest.xml
Generated automatically by SDK
mainTemplate.gradle
It must be checked. The required dependencies are automatically set by the EDM.
launcherTemplate.gradle
You can use the file provided by SDK unitypackage as it is.
baseProjectTemplate.gradle
It must be checked.
You can use the file provided by SDK unitypackage as it is.
gradleTemplate.properties
You can use files automatically generated by Unity and EDM. You can use the file provided by SDK unitypackage as it is.
proguard-user.txt
You can use the file provided by SDK unitypackage as it is.
I don't use it anymore from SDK 3.15.0 so it doesn't matter if you remove it.
1.1.4.4. Unity preferences in Android build setup
Since SDK 3.13.3 or later, upgrading is required for certain Unity versions and below, as the Gradle used during the build uses 6.1.1.
KakaoGame SDK for Unity Upgrade Guide | Upgrading the Android SDK to 3.13.3
1.1.4.5. Enable Http on Android build setup
If targetSdkVersion is set to 28 version or higher, and the game using http communication requires the following settings.
Do not use http inside the Cacao Game SDK. Set this only when the developer needs an http call with an issue such as cdn.
Required to use Kakao SDK v3.8.3 or later version
In the Unity Inspector, add the http domain to be used in the game via the Add button in the item "Use as needed" -> Domains to use HTTP (Android)
In 3.10.0 and later, API to load the following cafe view has been added. In order to use this API, all HTTP domains must be called, and the following settings are required.
Etc Setting -> HTTP Domain -> Use All HTTP Domain Check Setting
1.1.4.6. EDM Settings
The EDM provides a Resolver for downloading the necessary libraries.
First, click Android Resolver Setting. (Menu -> Assets → External Dependency Manager → Android Resolver → Settings)
droid Resolver → Settings)Set as follows. (You can set it differently as needed.)
1.1.4.7. How to change the Main Activity
The SDK automatically changes the main activity to KGUnityPlayerActivity.
To change the main activity, you can open KGSharedData.json and set the customManifest
to true
1.1.5. iOS Settings
In the Unity3d tool, select the 'File -> Build Settings ...' menu.
In the "Build Settings" window, set "Platfrom" to "iOS" and click the "Player Settings ..." button as shown below.
The iOS minimum supported version of the Kakao Game SDK is 11.0.
Click the Build button to build it. If the build succeeds, an Xcode project is created.
1.1.5.1. EDM Settings
Like Android, it provides a Resolver that downloads the libraries, and you need to configure it.
First, click Android Resolver Setting. (Menu -> Assets -> Play Services Resolver -> iOS Resolver -> Settings)
Set as follows. (You can set it differently as needed.)
1.1.6. Supported Language Resource in the Game
If there is additional language pack in the library other than supported languages in the game and you want to delete it, you can do so by deleting the folder shown below.
iOS
Based on the Unitypackage import folder, find Assets > KakaoGame > iOSPlugins > KakaoGameFramwork > KakaoGameResources.bundle and click "See Package Content".
Delete the folder of the language you want to remove.
1.1.7. Unity Editor Login
1.1.7.1. Setting the Kakao Login Environment on Unity Editor
Activate Web Platform
First, the web platform is activated in the KakaoGame app information on the Kakao Developers website. (The platform is not activated by default at the time of app registration. It must be activated.)
Add Platform - Web- Site Domain
3.14.6 or later
The url required to log in to Kakao Editor has been changed from https://dist-test-sdk.s3.amazonaws.com to https://kakao-sdk-release.s3.amazonaws.com.
under 3.14.6
Add "https://kakao-sdk-release.s3.amazonaws.com"
1.1.7.2. Unity SDK Configuration Settings
After checking the Editor login, register the JavaScript key on the Kakao developer site.
1.1.7.3. Using Kakao Login on Unity Editor
You can use Kakao Login on Unity Editor after completing the steps described above. Please see the following guide on how to use Kakao Login.
Call Start when logging in → When Login shows up, check if the IDP login option windows appears and select Login with Kakao.
A UI to enter the Kakao Authinfo appears. Then the Kakao Login page is opened using the default browser set in the PC or MAC.
When the user clicks the Login with Kakao button, the Login pop-up will appear if it is the first time using "Login with Kakao". If there is a history of login in the web page cache, a web page will show that the login response.
Copy the information shown on the web page as a response. Return to Unity Editor and enter the copied information and click OK.
When the above steps are followed, Kakao authentication will be completed. Log into the Genie platform using the information in the authenticated information editor environment (C# SDK) and issue playerId and zat normally to complete the login process.
1.1.8. Notes on Using the Unity SDK
1.1.8.1. Reference when using PlayerPref class
iOS / Android Native SDK has the logic to store the values that need to be stored in the internal logic in the app data.
In case the developer calls PlayerPref deleteAll to organize the game data -> In this case, the SDK will delete the data saved due to the necessity and SDK malfunction occurs.
It is necessary to implement the deletion of only the game data stored in the game by using deleteKey API rather than deleteAll by summarizing the key / value used by the developer.