Skip to content

In-game external browser call

Starting with Hive SDK v4 24.0.0, the ability to call an external browser within the game is provided. This means users can use an external browser while gaming without having to leave the game.

The in-game external browser call function not only reduces user bounce rate, but also provides a better user experience.

Note

For more information, see Android Custom tabs, iOS SFSafariViewController document.

Use

Instructions on how to use the in-game external browser call feature.

Settings function

The functions that can be set with InAppBrowserParam are as follows.

Features Content Default setting
NavigationColor Specifies the top navigation area color. OS default color
ButtonColor (iOS only supported) Specifies the top navigation area button color. OS default color
UrlBarHiding When a scroll event occurs, the top URL exposure area is hidden. true
AutoRedirectToExternalBrowser (Android only) If the browser app set in the terminal's default app is not supported, an external browser connection is automatically supported. true

Example code

The example code for setting the function using InAppBrowserParam is as follows.

using hive;

InAppBrowserParam param = new InAppBrowserParam.Builder("https://developers.withhive.com/")
                                                                        .setNavigationColor("#3891f0")
                                                                        .setButtonColor("#ffffff")
                                                                        .setUrlBarHiding(true)
                                                                        .setAutoRedirectToExternalBrowser(true)
                                                                        .build();

    PlatformHelper.showInAppBrowser(param, (ResultAPI result) => {
            if (result.isSuccess()) {
                    // API 호출 성공
            }
    });
    #include <HIVE_SDK_Plugin/HIVE_CPP.h>
    using namespace std;
    using namespace hive;

    InAppBrowserParam *param = new InAppBrowserParam("https://developers.withhive.com/");
    param->navigationColor = "3891f0";
    param->buttonColor = "#ffffff";
    param->urlBarHiding = true;
    param->autoRedirectToExternalBrowser = true;

    PlatformHelper::showInAppBrowser(*param, [=](ResultAPI const & result) {
            if (result.isSuccess()) {
                    // API 호출 성공
            }
    });
    import com.hive.PlatformHelper;
    import com.hive.ResultAPI;

    PlatformHelper.InAppBrowserParam param = new PlatformHelper.InAppBrowserParam.Builder("https://developers.withhive.com/")
                                    .setNavigationColor("#3891f0")
                                    .setUrlBarHiding(true)
                                    .setAutoRedirectToExternalBrowser(true)
                                    .build();

    PlatformHelper.showInAppBrowser(param, result -> {
            if (result.isSuccess()) {
                    // API 호출 성공
            }

    });
import com.hive.PlatformHelper
import com.hive.ResultAPI

val param = PlatformHelper.InAppBrowserParam.Builder("https://developers.withhive.com/")
                                        .setNavigationColor("#3891f0")
                                        .setUrlBarHiding(true)
                                        .setAutoRedirectToExternalBrowser(true)
                                        .build()

PlatformHelper.showInAppBrowser(param, object : PlatformHelper.InAppBrowserListener {
        override fun onInAppBrowser(result: ResultAPI) {
                if (result.isSuccess) {
                        // API 호출 성공
                }
        }
})
import HIVEService

let inAppBrowserParam = InAppBrowserParam.Builder(url: "https://developers.withhive.com/")
                                                .setNavigationColor("#3891f0")
                                                .setButtonColor("#ffffff")
                                                .setUrlBarHiding(true)
                                                .setAutoRedirectToExternalBrowserbuild(true)
                                                .build()

PlatformHelperInterface.showInAppBrowser(inAppBrowserParam) { resultAPI in
    if result.isSuccess() {
                // API 호출 성공
        }
};
#import <HIVEService/HIVEService-Swift.h>

HiveInAppBrowserParamBuilder *builder = [[HiveInAppBrowserParamBuilder alloc] initWithUrl: @"https://developers.withhive.com/"];
HiveInAppBrowserParam *inAppBrowserParam = [[[[[builder setNavigationColor: @"#3891f0"]
                                                                                                                    setButtonColor: @"#ffffff"]
                                                                                                                    setUrlBarHiding: YES]
                                                                                                                    setAutoRedirectToExternalBrowser: YES]
                                                                                                                    build];

[HIVEPlatformHelper showInAppBrowser: inAppBrowserParam handler: ^(HIVEResultAPI *result) {
        if ([result isSuccess]) {
                // API 호출 성공
        }
}];