Skip to content
Stove
Last Updated

This explains the basic integration flow from SDK initialization to shutdown.

SDK Basic Integration

Mobile SDK


This explains the basic flow for integrating the STOVE platform in the mobile environment (STOVE Mobile SDK).

This page covers only the 5 core steps of the boot flow.
ㆍ Proceed in the order Auth.initialize → AuthUI.setProviders → AuthUI.login → User.setGameProfile → Auth.AccessToken.
ㆍ Add-on features such as push, coupons, pop-ups, deep links, and Vietnam regulation are covered separately in the Feature Guides.

Overview

  • The STOVE platform provides an integrated service that makes game launches simple.
  • Integrating the STOVE Mobile SDK (hereafter Mobile SDK) into your game lets you easily integrate authentication, operations, and payment features.
  • The Mobile SDK can be used in 4 build environments: Android (Kotlin/Java), iOS, Unity, and Unreal.
  • The Auth/AuthUI module handles integrated login, automatically processing device registration, identity verification, terms agreement, and push registration in a single AuthUI.login call.
  • Detailed options for the full authentication/account-management flow (direct login, member conversion, manual identity-verification calls, etc.) are covered in the Sign-in Guide.

Prerequisites

Before proceeding with this guide, the items below must be ready.

Item Description Notes
Partners mobile-market info The package name / Bundle ID used as the identifier at SDK initialization. Must be pre-registered in Partners Launching > Service Integration
Provider authentication channels The authentication channels the game will support (STOVE, Google, Apple, Facebook, etc.).
The Partners registration order matches the AuthUI.setProviders input order
The integration guide for each Provider
SDK version Apply STOVE Mobile SDK 2.x or higher The environment-setup guide
Build-environment setup Per-environment SDK dependencies, manifest, and Info.plist settings for Android (Gradle) / iOS (Xcode) / Unity / Unreal The environment guide for each platform

Integration Flow

The Mobile SDK boot flow consists of 4 core calls and an automatic-processing area.


  • Game-start path
    • When the app runs, initialize the SDK with Auth.initialize. This step also checks for app updates and game maintenance.
    • Register the authentication channels the game will support with AuthUI.setProviders. The order becomes the login-screen display order as-is.
    • Call AuthUI.login to show the integrated login screen and receive an AccessToken.
    • After login completes, pass the character/world info to the SDK with User.setGameProfile.

  • Flow auto-processed inside AuthUI.login
    • A single integrated-login call also performs new-device registration, policy-required identity verification, terms agreement, and push registration.
    • The game doesn't need to call these directly. A separate call is needed only when re-showing them from in-game settings.

  • During gameplay
    • Once character setup finishes, enter the game's main screen.
    • The SDK auto-renews the AccessToken at 80% of expiry, so don't cache the token—look it up via Auth.AccessToken each time.

Integration Details

This explains the 5 core steps of the Mobile SDK boot flow with step-by-step scenarios and code examples.


1. SDK Initialization (Auth.initialize)

This is the step that acquires the initial info needed to use the service. Login, payment, and operations features become usable only after initialization completes.

  • Call conditions
    • Call once at app start.
    • It must be called before other Mobile SDK APIs.

  • How it works
    • It fetches the service settings registered in Partners (service_id, market_game_id).
    • It also checks whether an app update is needed (AppUpdateError 30004) and whether the game is under maintenance (MaintenanceError 30003).
    • Passing the Result from the response directly to OperationUI.handleResult automatically shows the maintenance/app-update notice UI. (no need to handle it yourself)

  • Sequence diagram


The SDK auto-handles app updates and game maintenance
ㆍ You don't need to analyze the Auth.initialize result yourself to build a notice screen.
ㆍ Passing the received Result directly to OperationUI.handleResult automatically shows the maintenance (30003) / app-update (30004) UI.
ㆍ Continue the next-step (login) flow inside the callback.



2. Authentication-Channel Setup (AuthUI.setProviders)

Before calling AuthUI.login, register the authentication channels (Providers) the game will support. The order of the passed array becomes the login-screen display order as-is.

  • Call conditions
    • Run it after Auth.initialize completes and before calling AuthUI.login.
    • Register once per game.

  • How it works
    • Pass the list of Providers the game supports to the SDK.
    • Only channels pre-registered in Partners work correctly. Adding an unregistered channel won't authenticate at login.
    • The email Provider is shown by default without adding it separately. (login-screen type B requires the email Provider)


Be sure to run this before calling AuthUI.login.
ㆍ If you call AuthUI.login with no Providers, the user can't select an authentication channel.
ㆍ The order you add them is the display order, so arrange them by marketing priority.



3. Integrated Login (AuthUI.login)

This is the step that handles everything at once—from showing the login screen to issuing the AccessToken and doing device registration, identity verification, terms agreement, and push registration.

  • Call conditions
    • Call it after both Auth.initialize and AuthUI.setProviders complete.
    • If an existing AccessToken exists, it's handled as auto-login; otherwise the login screen is shown to the user.

  • How it works
    • It shows the integrated-login UI and authenticates via the Provider the user selects.
    • After authentication, it issues/renews the AccessToken and delivers the user info via callback.
    • The items in the table below are all handled within a single call.

  • Flow auto-processed inside AuthUI.login
Feature Auto-display timing Cases needing a separate call
Device registration/management Auto-shown when new-device registration is needed When showing the device-management UI directly from the in-game settings screen
Identity verification Auto-shown when legally/policy-required verification is needed When forcing re-verification before entering payment/sensitive features
Terms agreement Auto-shown when a user who hasn't agreed enters
Push registration Auto-processed on login, token renewal, or account-linking completion

  • Sequence diagram


You don't need to call the auto-processed items separately
ㆍ Device registration, identity verification, terms, and push registration all proceed automatically in a single AuthUI.login.
ㆍ Only when you need to re-show them from in-game settings, call them directly by referring to the individual-call section of the Sign-in Guide.



4. Character/World Setup (User.setGameProfile)

After login completes, pass the user's character and world info to the SDK. The entered info is used per world/character in each feature (coupons/pop-ups/billing/push).

  • Call conditions
    • Call it after AuthUI.login succeeds, right before entering the game's main page.
    • Call it again when the user changes character or connects to a different world.

  • How it works
    • Create a GameProfile object with characterNumber and worldId and set it on AccessToken.user.
    • For games that don't support worlds, pass worldId as null. However, at least one default world must be registered in Partners.
    • The SDK doesn't check value validity (whether it's null), so please do a null check on the game side.


Character setup is required
ㆍ Without character setup, the world/character-based features set in Partners (coupons/pop-ups/billing/push) won't work correctly.
ㆍ Even a game that doesn't support worlds must register at least one default world in Partners, then call it passing worldId as null.



5. Using the AccessToken (Auth.AccessToken)

This is the step that looks up the token used when the game calls SDK features after character setup.

  • Call conditions
    • Call it whenever an AccessToken is needed during gameplay.
    • Don't cache the token value in a game variable; look it up anew at each point of use.

  • How it works
    • The SDK auto-renews when the AccessToken reaches 80% of its expiry time.
    • Auto-renewal only works while the process is running, so always get the latest value via Auth.AccessToken.
    • If the AccessToken is null, the login has been lost, so guide the user back to the login flow.


Always look up the token anew before use
ㆍ The SDK auto-renews at 80% of expiry, so continuing to use a cached token can miss the renewed one.
ㆍ If the AccessToken is null, the login has been lost. Call AuthUI.login again to guide the user into the re-login flow.

PC SDK


This explains the basic flow for integrating the STOVE platform in the PC environment (PCSDK3).

  • The STOVE platform provides an integrated service that makes game launches simple.
  • Integrating the STOVE PC SDK (hereafter PC SDK) into your game lets you easily integrate STOVE platform services.
  • The STOVE PC Base SDK (hereafter Base SDK) is the required module that provides the basic features of STOVE platform services.

The Base SDK is a prerequisite for all PC SDK features.
ㆍ The Base SDK is a module you must integrate to use STOVE platform services.
ㆍ If the Base SDK isn't initialized, other PC SDK modules won't work.
ㆍ The Base SDK is applied through client integration.

Prerequisites

Before proceeding with this guide, please first complete the Development Environment Setup process. The flow below can only proceed smoothly once the getting-started process is done.

Fullscreen-mode limitations
ㆍ If you use the View SDK (pop-ups) or IAP SDK (purchase window) modules, there are limitations on the game screen's Fullscreen mode.
ㆍ For details, refer to each module's integration overview.
ㆍ If you don't use the View SDK or IAP SDK, this limitation doesn't apply.

Integration Flow

The Base SDK integration flow is as follows.


  • Game-start path
    • At game start, verify whether the game was launched from the launcher.
    • At game start, initialize the Base SDK.
    • Configure the API-callback execution loop so that, each cycle when PC SDK APIs run, any callbacks queued in the callback queue are executed.

  • Optionally implement to fit the game after configuring the API-callback execution loop
    • Set the language to use in the PC SDK.
    • Character/world setup (register the currently connected worldId and characterNumber to the PC SDK.)
    • Integrate the overindulgence-prevention feature.
    • Integrate the Game-Time Choice System feature.

  • Features optionally usable during gameplay
    • Get the current user's Game Access token.
    • Get the current user's info.
    • Get the current user's GDS info.
    • Get the current user's Signin info.
    • Register a Game Access-token renewal-notification callback. (the token is auto-renewed inside the SDK, and the registered callback is called at renewal.)

  • Game-exit path
    • When the user exits the game, clean up the Base SDK, then have the game finally exit.

Integration Details

This explains the typical scenario for integrating the Base SDK with sequence diagrams and code examples.


1. Launcher-Launch Verification and Base SDK Initialization

If the game is an official release build, first verify whether it was launched from the launcher, then initialize the Base SDK right away. Verification and initialization are bundled into one call flow.

This is a required function that must be executed.
ㆍ If you don't call Base_RestartAppIfNecessaryAsync, you won't receive the required info for launching the game from the launcher (service settings, authentication context, etc.), so subsequent SDK APIs won't work correctly.
ㆍ The initialization parameters passed at the call are cached inside the SDK and become the input for Base_InitializeEx, so be sure to connect verification and initialization into one flow.


  • Call conditions
    • In an official release build, the game runs correctly only after verifying it was launched via the launcher.
    • Base SDK initialization must happen before other PC SDK module initialization.
    • Both APIs must be called on the UI Thread.
    • It must be called after game start and before using other Base SDK features.
    • It must run only once when the game launches. Don't repeat Init/UnInit during execution.

  • How it works
    1. Launcher verification: Base_RestartAppIfNecessaryAsync handles verification asynchronously. The result is delivered via the callback's restartAppIfNecessary argument.
      • If restartAppIfNecessary is true, it means the game was relaunched via the launcher, so the current game instance must exit.
      • The timeout (milliseconds) for waiting on the launcher response is passed via the waitTimeMillisec argument of Base_RestartAppIfNecessaryAsync. Typically 60,000 (60 seconds) is used.
    2. Parameter cache: the initParam passed at the verification call is cached inside the SDK.
    3. Base SDK initialization: in the verification callback's restartAppIfNecessary == false branch, call Base_InitializeEx to initialize with the cached parameters. No need to pass parameters again.
      • If you use other modules such as View or IAP, call each module's initialization function (e.g., View_Initialize, IAP_Initialize) separately after Base SDK initialization. Other modules such as PCBang also follow their own initialization flows.

Be careful with the lifetime of initParam referenced in the callback.
initParam must be alive when the async callback is called. Declare it as a static or member variable in Native/Unreal, and as a class member variable in Unity.

If there are no pre-cached parameters, Base_InitializeEx fails.
ㆍ Be sure to use Base_InitializeEx only after calling Base_RestartAppIfNecessaryAsync first.


  • Sequence diagram

  • Code example

Any function in the examples that does not start with Base_ is a placeholder the SDK does not provide.

Game-loop functions such as GameLoop(), ProcessGameLogic(), and Render() are named only to explain the example — you implement them yourself for your game. Every function PCSDK3 provides starts with a module prefix such as Base_, IAP_, or View_.

cpp
#include "BaseSDK.h"

using namespace Stove::PCSDK;
using namespace Stove::PCSDK::Base;

void Base_RestartAppIfNecessaryAsync_Example()
{
    // Declared static since it's referenced in the callback
    static StovePCInitializeParam initParam;
    initParam.SetEnvironment(L"YOUR_ENV(ex.SANDBOX)");
    initParam.SetGameID(L"YOUR_GAME_ID");
    initParam.SetApplicationKey(L"YOUR_APP_KEY");

    // Call Base_RestartAppIfNecessaryAsync (60-second timeout)
    Base_RestartAppIfNecessaryAsync(&initParam, 60'000, [](
        CallbackResult callbackResult, bool restartAppIfNecessary)
    {
        if (restartAppIfNecessary)
        {
            // Relaunched via the launcher, so exit the current instance
            return;
        }

        // Verification passed → initialize the Base SDK with cached parameters (Base_InitializeEx)
        Base_InitializeEx([](CallbackResult initResult)
        {
            if (initResult.GetResult().IsSuccessful())
            {
                // Implement the logic for Base SDK initialization success.
                // e.g., you can run other SDK modules' Initialize here.
            }
            else
            {
                // Implement the logic for Base SDK initialization failure.
            }
        });
    });
}



2. API-Callback Execution

This is the step that executes callbacks registered on the PC SDK's async APIs. Registered callbacks are queued in the callback queue, and the queued callbacks are executed all at once when this API is called.

  • Callbacks registered on PC SDK modules other than the Base SDK (View, IAP, PCBang, etc.) are also executed in this one function.
  • If you don't call it periodically in the game's main loop, some PC SDK APIs may not work correctly.
  • This API must be called on the UI Thread.

  • Comparison of the two options
API Behavior When to use
Base_RunCallback() Executes all queued callbacks at once A general game loop where callback-processing time doesn't greatly affect the frame
Base_RunCallbackWithTimeout(ms) Executes only up to the specified timeout (ms) and continues the rest on the next call Frame-sensitive games such as action/MMO where callback-execution time can cause frame drops

Callback-execution thread guidance
ㆍ All SDK callbacks are executed on the calling thread at the point Base_RunCallback() / Base_RunCallbackWithTimeout() is called.
ㆍ If you call it in the game's main loop, the callbacks also run safely on the main thread.

Caution when using variables in callbacks
ㆍ If you capture a local variable by reference ([&]) in an async API's callback (lambda), the variable may already be destroyed when the callback runs.
ㆍ Declare variables used in callbacks as static or class member variables.


  • Sequence diagram

  • Code example
cpp
#include "BaseSDK.h"

using namespace Stove::PCSDK;
using namespace Stove::PCSDK::Base;

void GameLoop()
{
    while (gameRunning)
    {
        ProcessGameLogic();

        // Option A: execute all queued callbacks at once
        Base_RunCallback();

        // Option B: limit callback-execution time to a maximum of 10ms
        // If the time is exceeded, remaining callbacks continue on the next call
        // Base_RunCallbackWithTimeout(10);

        Render();
    }
}



3. Access-Token Lookup and Renewal-Notification Registration

The Access token used for STOVE platform authentication is automatically renewed inside the PCSDK 10 minutes before expiry. In game code, you can handle the token with two APIs.


  • Comparison of the two APIs
API Purpose When to use
Base_GetAccessToken Immediately look up the currently valid Access token Call it whenever you need to pass the token externally, such as game-server authentication or STOVE REST API calls. The latest value is always returned.
Base_AccessTokenRenewed Register a notification callback for when auto-renewal occurs Register a callback when follow-up work such as game-server sync or cache invalidation is needed right after the token is auto-renewed inside the SDK. Register only once during game execution.

Don't cache the token in a game variable.
ㆍ The token is auto-renewed 10 minutes before expiry, so look up the latest value with Base_GetAccessToken whenever an external call is needed.
ㆍ No API is provided to force-trigger renewal. If follow-up work is needed after renewal, register a callback with Base_AccessTokenRenewed.

Call Base_AccessTokenRenewed only once.
ㆍ This API is a callback-registration API, so call it only once during game execution.
ㆍ The best place to call it is right after Base_InitializeEx succeeds, when other PCSDK initialization finishes.


  • Sequence diagram

  • Code example
cpp
#include "BaseSDK.h"

using namespace Stove::PCSDK;
using namespace Stove::PCSDK::Base;

// (1) Register the renewal-notification callback - call once right after initialization
void Base_AccessTokenRenewed_Example()
{
    Base_AccessTokenRenewed(
        [](CallbackResult callbackResult, StovePCToken token)
        {
            if(callbackResult.GetResult().IsSuccessful())
            {
                // Implement follow-up processing after the Access token is auto-renewed.
                const wchar_t* renewed = token.GetAccessToken();
            }
            else
            {
                // Implement the logic for renewal failure.
            }
        }
    );
}

// (2) Immediately look up the current Access token - call right before each external call
void Base_GetAccessToken_Example()
{
    // Prepare a buffer large enough to receive the token.
    wchar_t accessToken[4096] = { 0 };
    auto result = Base_GetAccessToken(accessToken, 4096);
    if(result.IsSuccessful())
    {
        // The accessToken buffer is always filled with the latest token. Use it for external server calls, etc.
    }
    else
    {
        // Implement the logic for lookup failure.
    }
}



4. User/Country/Authentication Info Lookup

Info about the user currently logged in via the STOVE launcher is provided split across three APIs. Choose the API that fits your purpose—game screen, policy branching, judging payment eligibility, etc.

API Return struct Lookup target
Base_GetUser StovePCUser STOVE user basic info (nickname, game-user ID)
Base_GetGds StovePCGds Access country, regulation, timezone, language (Geo-based Distribution Service)
Base_GetSignin StovePCSignin Login authentication info (identity verification, email verification, sign-up country, IDP)

All three APIs are callable after Base SDK initialization completes.
ㆍ Call them freely whenever you need user context. The return values are cached by the SDK, so the call cost is low.


4-1. Base_GetUser — User basic info

Info provided by StovePCUser:

Field Type Description
nickname string The STOVE nickname of the user logged in via the STOVE launcher. Used for in-game UI display name, chat, customer inquiries, etc.
gameUserId uint64 The game-user identifier issued by the STOVE platform. Used on the game's own server to identify the STOVE account or as a key value for payment/log tracing.

4-2. Base_GetGds — Access country/regulation/locale

GDS (Geo-based Distribution Service) is country/regulation/locale info based on the user's access IP. Used for per-region policy branching such as Vietnam regulation, shutdown, and terms-display language.

Info provided by StovePCGds:

Field Type Description
isDefault bool If the country code can't be identified by IP, the STOVE default is returned and this is true. If identified by IP, it's false.
nation string The access country code (ISO 3166-1 alpha-2). e.g., KR, VN, US.
regulation string The regulation name applied to the access country code. (e.g., Vietnam age-rating display / Korea shutdown policy, etc.)
timeZone string Access timezone info. Used for displaying maintenance/event times, etc.
utcOffset int The UTC offset of the access timezone (in minutes).
language string The access language code.

4-3. Base_GetSignin — Login authentication info

Looks up the STOVE platform authentication context in which the game is currently running. You can check whether identity/email verification is done, the sign-up country, the IDP (Identity Provider) used, etc.

Info provided by StovePCSignin:

Field Type Description
personVerify bool Whether identity verification is done.
emailVerify bool Whether email verification is done.
nationality string The STOVE platform sign-up country code (ISO 3166-1 alpha-2).
providerCode string The IDP code used at STOVE login. On PC, use this field.
SO Stove email / FB Facebook / NAVER Naver / GP Google / APPLE Apple / LINE Line / STEAM Steam / QR QR login / RT PC-client-based auto-login, etc.

On PC, please use providerCode.
ㆍ The accountType also defined in the Signin info is a mobile legacy spec, so it isn't used on PC.


  • Sequence diagram

  • Code example
cpp
#include "BaseSDK.h"

using namespace Stove::PCSDK;
using namespace Stove::PCSDK::Base;

// (1) Look up user basic info
void Base_GetUser_Example()
{
    StovePCUser user;
    auto result = Base_GetUser(&user);
    if(result.IsSuccessful())
    {
        const wchar_t* nickname = user.GetNickname();
        uint64_t gameUserId = user.GetGameUserId();
    }
}

// (2) Look up access country/regulation/locale
void Base_GetGds_Example()
{
    StovePCGds gds;
    auto result = Base_GetGds(&gds);
    if(result.IsSuccessful())
    {
        const wchar_t* nation = gds.GetNation();
        bool isDefault = gds.IsDefault();
        const wchar_t* regulation = gds.GetRegulation();
        const wchar_t* language = gds.GetLanguage();
        const wchar_t* timeZone = gds.GetTimeZone();
    }
}

// (3) Look up login authentication info
void Base_GetSignin_Example()
{
    StovePCSignin signin;
    auto result = Base_GetSignin(&signin);
    if(result.IsSuccessful())
    {
        const wchar_t* providerCode = signin.GetProviderCode();
        bool personVerify = signin.GetPersonVerify();
        bool emailVerify = signin.GetEmailVerify();
        const wchar_t* nationality = signin.GetNationality();
    }
}



5. Character/World Setup

Register the world identifier (worldId) and character identifier (characterNumber) the game is currently connected to into the PC SDK via the Base_SetGameProfile API. The registered identifiers are used as key values by payment/operations features to distinguish user context.

Field Type Description
worldId string The identifier of the world (server) the user connected to. Games that don't support worlds register one default world in Partners and use that identifier.
characterNumber long The identifier of the character the user selected. Update it whenever the character changes or the user reconnects to a different world.

It directly ties into billing (payment) processing.
ㆍ STOVE payment (IAP) performs receipt, item-grant, and refund processing based on the worldId + characterNumber at the time of payment.
ㆍ If you call IAP_StartPurchase, etc. without character/world set, payment may fail or, even if it succeeds, the grant target may be identified incorrectly.
ㆍ If you use user-context-based modules such as payment/coupons, be sure to call it right before entering the main screen (when character selection is complete).


  • Call conditions and cautions
    • Without setting character/world, some PC SDK modules such as payment (IAP) and coupons may not work correctly.
    • The SDK doesn't separately check input validity, so check for null/empty strings on the game side before calling.
    • The entered character/world info is valid for the PC SDK's lifecycle. If you reinitialize after Base_UnInitialize, you must call Base_SetGameProfile again.
    • When the context changes via the user changing character or moving worlds, call it again immediately to update the identifiers.

  • Sequence diagram

  • Code example
cpp
#include "BaseSDK.h"

using namespace Stove::PCSDK;
using namespace Stove::PCSDK::Base;

// The function naming is an example; change it to fit your game's implementation.
void Base_SetGameProfile_Example()
{
    // Create the StovePCGameProfile struct
    // Assign appropriate worldId and characterNumber values to the struct fields.
    auto gameProfile = StovePCGameProfile(L"YOUR_WORLD_ID", 0L);

    // Call Base_SetGameProfile using the created struct
    auto result = Base_SetGameProfile(&gameProfile);
    if(result.IsSuccessful())
    {
        // Implement the logic for character/world setup success.
    }
    else
    {
        // Implement the logic for character/world setup failure.
    }
}



6. Base SDK Cleanup

Call the Base_UnInitialize API to clean up the Base SDK and return the resources in use. You must run the Base SDK cleanup logic before the game exits.

  • Call conditions
    • Base SDK cleanup must happen last, after other PC SDK cleanup. Cleaning up the Base SDK before other PC SDK cleanup may leave it not cleaned up properly.
    • After cleaning up the Base SDK, you can't use Base SDK features.
    • Base SDK cleanup must be called on the UI Thread.
    • It must run only once when the game exits.

  • Sequence diagram

  • Code example
cpp
#include "BaseSDK.h"

using namespace Stove::PCSDK;
using namespace Stove::PCSDK::Base;

void Base_UnInitialize_Example()
{
    // If you used other SDKs, Base_UnInitialize() must be called last.
    // e.g., cleanup order
    // PCBang_UserLogOut();
    // PCBang_UnInitialize();
    // View_UnInitialize();
    // IAP_UnInitialize();
    // Base_UnInitialize();
    auto result = Base_UnInitialize();
    if(result.IsSuccessful())
    {
        // Implement the logic for Base SDK cleanup success.
    }
    else
    {
        // Implement the logic for Base SDK cleanup failure.
    }
}



Need to contact us directly? stove.developers@smilegate.com