SDK Integration
This page shows you how to download, import, and configure the HaChi Unity Plugin.
tip
- Xcode 14.2 or later is required to access the HaChiSDK.
- If you want to update a new version of the SDK, delete the old version of the SDK first, except the configuration file. And export new Xcode or Android Studio projects, be careful not to overwrite projects exported to older versions of the SDK.
Download the latest Unity plugin
HCSDK_2.3.5_57a32d5.unitypackage(Release note)
Import the plugin into Unity
Perform the following steps to import the downloaded plug-in:
In Unity, select Assets > Import Package > Custom Package...
Select the Unity Plugin file you downloaded.
In the Import Unity Package dialog box, click Import.
How do I determine the current SDK version
The SDK Version can be obtained in the HCNativeInterface.cs file, as shown below:

Unity Android platform setup
1、Enable Android Auto-resolution? Please check "Disable".

2、Enable Android Gradle templates? Please check "Disable".

3、Player Setting
- Mininum API Level is set to 23
- Target API Level is set to 33
- Set IL2CPP
- Select ARMv7 and ARM64

4、Tick configuration

5、Unity versions later than 2022.3 require a custom gradle configuration.
"toolbar>Settings>Preferences > External Tools", Cancel "Gradle Installed with Unity (recommended)" Also set a custom gradle path.
Custom than 6.7.1 gradle version requirements, recommend download https://downloads.gradle.org/distributions/gradle-6.7.1-all.zip and decompression.

6、Assets/Plugins/Android/FirebaseApp.androidlib directory path does not exist or is empty cases need to check:
1、 Check whether GoogleService.json(Android) has been copied in Parameter Configuration .
2、Restart the unity editor.
Unity iOS platform setup

Parameter configuration
1, the requirements document configuration file :
GoogleService-Info.plist (iOS project will have this file)
google-services.json (Android project will have this file)
Added to the project Assets/ root directory. (If the sdk originally had this test file, please delete it, make sure to use the parameter file corresponding to the game)
- Put the configuration file in the requirements document in the Assets/StreamingAssets/ directory
Note: The above documents can be found in the requirements document, as shown below:
Project configuration
FB SDK configuration: Fill in the Facebook AppName(Current App Name) App Id and Client Token:
Initialize SDK
void Start()
{
HCSDKManager.Instance.InitializeSdk(InitSdkCallback);
}
private void InitSdkCallback()
{
// SDK initialization completes the callback
}
The initialization method automatically initializes the following parts:
- AppTrackingTransparency system (iOS ATT box)
- Statistics
- Advertising