DLC Integration Guide
Querying and Purchasing DLC
Please download the TapSDK and add the following dependencies to your game:
- Unity
- Android
- iOS
You can add the SDK either manually or with the Unity Package Manager.
If you choose to use the Unity Package Manager, you should add the following dependencies into Packages/manifest.json
:
"dependencies":{
"com.taptap.tds.common":"https://github.com/TapTap/TapCommon-Unity.git#3.28.3",
"com.taptap.tds.dlc": "https://github.com/TapTap/TapLicense-Unity.git#3.28.3",
"com.leancloud.storage": "https://github.com/leancloud/csharp-sdk-upm.git#storage-2.3.0",
}
If you choose to manually import the SDK, you should:
- In the download page, click
TapSDK Unity
to downloadTapSDK-UnityPackage.zip
. - Go to your Unity project, navigate to Assets > Import Package > Custom Package, select the
TapTap_Common
andTapTap_License
modules from unzipped SDK. - Download LeanCloud-SDK-Storage-Unity.zip, unzip it as a
Plugins
folder, and drag and drop the folder into Unity.
Import the SDK to the project/app/libs
of your game project. Then open project/app/build.gradle
and add the following lines:
repositories{
flatDir {
dirs 'libs'
}
}
dependencies {
implementation name:'TapCommon_3.28.3', ext:'aar'
implementation name:'TapLicense_3.28.3', ext:'aar'
}
// Not supported yet
DLC Callback Settings
- Unity
- Android
- iOS
public class MyTapDLCCallback:ITapDlcCallback
{
public void OnQueryCallBack(TapLicenseQueryCode code, Dictionary<string, object> queryList)
{
}
public void OnOrderCallBack(string sku, TapLicensePurchasedCode status)
{
}
}
TapLicense.SetDLCCallback(new MyTapDLCCallback());
TapLicenseHelper.setDLCCallback(new DLCManager.InventoryCallback() {
@Override
public boolean onQueryCallBack(int i, HashMap<String, Integer> hashMap) {
return false;
}
@Override
public void onOrderCallBack(String s, int i) {
}
});
// Not supported yet
Querying DLC
- Unity
- Android
- iOS
TapLicense.QueryDLC(string[] skuIds);
TapLicenseHelper.queryDLC(Activity activity, String[] skuIds);
// Not supported yet
Purchasing DLC
- Unity
- Android
- iOS
TapLicense.PurchaseDLC(string skuId);
TapLicenseHelper.purchaseDLC(Activity activity, String skuIds);
// Not supported yet
Parameters
TapLicenseQueryCode
Callback | Callback value | Description |
---|---|---|
QUERY_RESULT_OK | 0 | Query succeeded |
QUERY_RESULT_NOT_INSTALL_TAPTAP | 1 | TapTap is not installed on the device |
QUERY_RESULT_ERR | 2 | Query failed |
ERROR_CODE_UNDEFINED | 80000 | Unknown error |
skuId
This is a unique ID assigned to each product. Please reach out to TapTap to have them set up.
Testing
To ensure that players are able to make purchases once you have released your game, please follow the instructions below to test the payment procedure
Upload APK
Upload the APK of your game to the TapTap Developer Center and wait for it to go through the review process.
Add Test Users
Go to TapTap Developer Center >> Click on Game Services >> Click on Game Ecosystem >> Click onCopyright Verification >> Enter the TapTap ID of the test user
Start Testing
Log in to the TapTap app on your device with the test account.
Start Selling
Complete Application Information
Go to TapTap Developer Center and fill in the application information, then wait for the review.
Set Prices
Go to TapTap Developer Center >> Price Settings, enable the feature, set up the prices, and submit everything for review.
Release Your Game
If everything worked out well, you may release your game.