Skip to content

Funtap Publisher Integration Guide

Overview

The Funtap publisher Software Development Kit (SDK) integration guide explains how to apply this SDK to an Android game after completing a publishing contract with Funtap and configure an Appraisal Build for Vietnam publishing license review and a Service Build for live service. Hive SDK integrates the User Interface (UI) and Application Programming Interface (API) required for the sign-in screen and user information update feature by using different Funtap modules and configuration values depending on the build type. With this configuration, you can prepare Android builds that comply with Vietnam service policies and government regulations.

How to apply Appraisal Build

Appraisal Build is the build submitted for Vietnam publishing license review. In this build, the Funtap sign-in feature must work properly.

Preparation

Before starting the Appraisal Build work, you must receive the appraisal appKey from Funtap. In Native, enter this value in hive_config.xml. In Unity, enter it in the Funtap appKey field under top toolbar > Hive > HiveConfig > Optional. If the value is not ready, you cannot complete Step 3.

Step 1. Set up the Funtap-Appraisal library

In Native, add the dependency for Appraisal to the module-level build.gradle file.

// Funtap Appraisal module
implementation "com.com2us.android.hive:hive-authv4-provider-funtap-appraisal"

In Unity, click ExternalDependency under top toolbar > Hive, then select the Funtap-Appraisal item.

Step 2. Set permissions for the Funtap-Appraisal library

To integrate the Funtap-Appraisal library, add the following permission settings to the AndroidManifest.xml file.

In Native, add the permissions to the module-level AndroidManifest.xml file.

  • <project>/app/src/main/AndroidManifest.xml

In Unity, add the permissions to the AndroidManifest.xml file under Plugins/Android.

  • <project>/Assets/Plugins/Android/AndroidManifest.xml

Add the following permissions.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

Step 3. Apply the Funtap publisher setting value (appKey)

In Native, add the appKey received from the Funtap publisher to the hive_config.xml file.

<funtap-appraisal appKey="YOUR_APP_KEY" />

In Unity, click Optional under top toolbar > Hive > HiveConfig, then enter the issued value in Funtap's appKey field.

Step 4. Verify Funtap sign-in behavior

In Appraisal Build, call Funtap sign-in and verify that the sign-in screen is displayed correctly and that sign-in succeeds. Hive SDK includes the Funtap SDK internally and uses ProviderType.FUNTAP when calling AuthV4.signIn(). After sign-in succeeds, the follow-up processing required for publisher integration proceeds automatically inside the Funtap SDK.

Caution

Use ProviderType.FUNTAP sign-in only in Appraisal Build. Do not use this sign-in type in Service Build.

using hive;

AuthV4.signIn(AuthV4.ProviderType.FUNTAP, (ResultAPI result, AuthV4.PlayerInfo playerInfo) => {
    if (result.isSuccess()) {
        // ProviderType FUNTAP sign-in succeeded
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>

AuthV4::signIn(ProviderType::FUNTAP, [=](ResultAPI const & result, PlayerInfo const & playerInfo) {
    if (result.isSuccess()) {
        // ProviderType FUNTAP sign-in succeeded
    }
});
import com.hive.AuthV4
import com.hive.ResultAPI

AuthV4.signIn(AuthV4.ProviderType.FUNTAP, object : AuthV4.AuthV4SignInListener {
    override fun onAuthV4SignIn(result: ResultAPI, playerInfo: AuthV4.PlayerInfo?) {
        if (result.isSuccess) {
            // ProviderType FUNTAP sign-in succeeded
        }
    }
})
import com.hive.AuthV4;
import com.hive.ResultAPI;

AuthV4.signIn(AuthV4.ProviderType.FUNTAP, (result, playerInfo) -> {
    if (result.isSuccess()) {
        // ProviderType FUNTAP sign-in succeeded
    }
});

How to apply Service Build

Service Build is the build used to operate the live service after obtaining the Vietnam publishing license. In this build, use the service Funtap module and the token setting.

Preparation

Before starting the Service Build work, you must receive the service token from Funtap. In Native, enter this value in hive_config.xml. In Unity, enter it in the Funtap token field under top toolbar > Hive > HiveConfig > Optional. If the value is not ready, you cannot complete Step 2.

Note

In Hive Console > Provisioning > SDK settings, you can control whether Funtap identity verification is displayed after sign-in for Hive SDK v4 Android only.

Use the Service Build features only after completing the login flow already implemented in the game. After sign-in succeeds, use the PlayerID received in the PlayerInfo response as the userId for subsequent Funtap APIs.

Step 1. Set up the Funtap library

In Native, add the dependency for service use to the module-level build.gradle file.

// Funtap Service module
implementation "com.com2us.android.hive:hive-authv4-provider-funtap"

In Unity, click ExternalDependency under top toolbar > Hive, then select the Funtap item.

Step 2. Apply the Funtap publisher setting value (token)

In Native, add the token received from the Funtap publisher to the hive_config.xml file.

<funtap token="YOUR_TOKEN" />

In Unity, click Optional under top toolbar > Hive > HiveConfig, then enter the issued value in Funtap's token field.

Step 3. Check whether the government review is in progress

To decide whether to display the manual information update menu in Service Build, the user must first be signed in successfully. When opening the character information screen or settings screen after sign-in, call ProviderFuntap.isFuntapUnderGovernmentReview() to check whether the review is in progress. If the result is true, it is the government review period, so Hive SDK automatically displays the WebView-style identity verification screen shown below immediately after sign-in. In this case, do not display a separate manual information update UI.

Example identity verification popup screen

If the result is false, proceed to the next step.

using hive;

bool result = ProviderFuntap.isFuntapUnderGovernmentReview();
#include <HIVE_SDK_Plugin/HIVE_CPP.h>

bool result = ProviderFuntap::isFuntapUnderGovernmentReview();
import com.hive.ProviderFuntap

val result = ProviderFuntap.isFuntapUnderGovernmentReview()
import com.hive.ProviderFuntap;

boolean result = ProviderFuntap.isFuntapUnderGovernmentReview();

Step 4. Check whether the user has completed information entry

If the result in Step 3 is false, determine whether the user can proceed with a manual information update. For userId, pass the PlayerID received in the PlayerInfo response after successful sign-in as a string. For more information about the PlayerInfo response values, refer to Before you start.

If the isCompleted value returned by ProviderFuntap.checkUserInfoComplete(userId) is true, the information has already been entered, so do not display the UI. If the isCompleted value is false, provide the information update UI in the next step.

using hive;

string userId = "USER_ID";

ProviderFuntap.checkUserInfoComplete(userId, (ResultAPI result, bool isCompleted) => {
    if (result.isSuccess()) {
        // Display the information update UI if isCompleted is false
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>

std::string userId = "USER_ID";

ProviderFuntap::checkUserInfoComplete(userId, [=](ResultAPI const & result, bool isCompleted) {
    if (result.isSuccess()) {
        // Display the information update UI if isCompleted is false
    }
});
import com.hive.ProviderFuntap
import com.hive.ResultAPI

val userId = "USER_ID"

ProviderFuntap.checkUserInfoComplete(userId) { result: ResultAPI, isCompleted: Boolean ->
    if (result.isSuccess) {
        // Display the information update UI if isCompleted is false
    }
}
import com.hive.ProviderFuntap;
import com.hive.ResultAPI;

String userId = "USER_ID";

ProviderFuntap.checkUserInfoComplete(userId, (result, isCompleted) -> {
    if (result.isSuccess()) {
        // Display the information update UI if isCompleted is false
    }
});

Step 5. Display the information update UI

If the isCompleted value in Step 4 is false, provide a menu that the user can select directly on the character information screen or settings screen. When the user selects that menu, call ProviderFuntap.showUpdateUserInfo(userId) to open the information update screen.

using hive;

string userId = "USER_ID";

ProviderFuntap.showUpdateUserInfo(userId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API call succeeded
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>

std::string userId = "USER_ID";

ProviderFuntap::showUpdateUserInfo(userId, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API call succeeded
    }
});
import com.hive.ProviderFuntap
import com.hive.ResultAPI

val userId = "USER_ID"

ProviderFuntap.showUpdateUserInfo(userId) { result: ResultAPI ->
    if (result.isSuccess) {
        // API call succeeded
    }
}
import com.hive.ProviderFuntap;
import com.hive.ResultAPI;

String userId = "USER_ID";

ProviderFuntap.showUpdateUserInfo(userId, (result) -> {
    if (result.isSuccess()) {
        // API call succeeded
    }
});