Skip to content

DMM GAMES Integration Guide

To integrate DMM GAMES with your app, you must first sign a contract. After signing the contract, implement the integration by referring to this guide.

The supported DMM GAMES integration scope differs by app execution environment.

  • PC: Supports both authentication and billing for store release.
  • Mobile: Supports only IdP login authentication integration.

Prerequisites

1. Issue credentials and check key values in the DMM Developer Site

  • PC: Check the three key values issued from the DMM ClientGame Developer Site.
    • App ID(アプリID), Consumer Key(コンシューマーキー), Consumer Secret(コンシューマーシークレット) - check ゲーム管理 > ゲーム情報 > 基本情報 image
    • When registering the app in the DMM console, select the API payment method.
  • Mobile: Issue DMM credentials.

    • First register mobile app information, such as the package name and app information, in the DMM GAMES developer console, and then issue the credentials below. DMM authentication uses two types of credentials: OpenSocial and AuthSDK.
    Category Key Description
    OpenSocial appId OpenSocial app ID. This is the makeRequest opensocial_app_id value and is used for signature verification.
    OpenSocial consumerKey, consumerSecret Consumer credentials for signatures. Check these in the DMM console after app registration.
    AuthSDK clientId, clientSecret, secretKey OAuth2 login credentials. The DMM AuthSDK on the device consumes these values, and they are not sent to the Hive server. Apply separately to DMM to have them issued.
    AuthSDK redirectUri OAuth2 callback scheme. DMM binds this value to clientId and provides it together when you apply.

2. Prepare an App ID

  • In App Center > App ID Management > New App ID, create an App ID that matches the OS and store. For the PC environment, select Windows as the OS and DMM GAMES as the store.
  • App ID example: com.[company name].[project name].windows.dmm

3. Configure authentication

4. Configure billing


Implementing DMM Login

PC environment integration (DMM GAME PLAYER environment)

Implement by referring to Login/Logout.

Warning

Do not run the app if execution parameters do not exist.

If the app is not launched through DMM GAME PLAYER and the execution parameters viewer_id and onetime_token are not passed, do not run the app and handle it by exiting. For details about how parameters are passed, refer to the DMM GAMES PLAYER service policy in DMM GAMES Developer Support.

When the app execution environment is PC (DMM GAME PLAYER), consider the following for DMM login integration.

  • Hive SDK receives the execution parameters viewer_id and onetime_token passed by the DMM GAME PLAYER launcher and processes DMM account login without a separate login UI. Therefore, the app connects the DMM account login process without separately implementing a login flow for the DMM execution environment.
  • DMM login proceeds with the implicit login method AuthV4.Helper.signIn or AuthV4.signIn(ProviderType.DMM). When login succeeds, the automatic login session is saved, and you can also log in later with AuthV4.signIn(ProviderType.Auto). Check the providerUserId based on the user identifier viewer_id in the DMM provider information of the login result PlayerInfo.
  • If the app is launched through DMM GAME PLAYER and launcher parameters are passed, implicit login always works with the DMM account without a first-time-only restriction, and the explicit login UI showSignIn is not used. For general Windows implicit login behavior, refer to Implicit Login Behavior: PC.
  • The management token onetime_token is valid for 90 minutes according to DMM policy. Hive SDK refreshes it automatically internally, so you do not need to implement this separately. However, if refresh fails because the network is disconnected for a long time and the token fully expires, the SDK cannot recover on its own. Restart the app to receive a new token. DMM API calls such as billing require a valid management token.
  • When running through DMM GAME PLAYER, do not use the logout method signOut. Because DMM works as launcher-based automatic login, do not use the IdP selection UI showSignIn either.

DMM authentication is the authentication method used when a user runs an app through DMM GAME PLAYER on Windows. It works as launcher-based automatic login and is not exposed in the explicit login UI IdP selection list.

Mobile environment integration

Mobile DMM login is used in the same way as other IdPs, such as Google and Apple, by calling AuthV4.signIn(ProviderType.DMM). The provider internally handles DMM SDK initialization, login, and signature verification integration.

Configure keys in hive_config.xml

Enter values in the providers tag of the hive_config.xml file by referring to the example code below. Apply only one block that matches the developmentMode of your environment among the Sandbox and production (Service) examples.

<!-- Sandbox configuration -->
    <properties>
    <!-- Hive SDK common settings omitted -->

    <!-- Hive SDK authentication settings: START -->
                <providers>
                        <!-- Log in with DMM (DMM) -->
                        <dmm appId="123456" developmentMode="sandbox" redirectUri="app-redirect-url" consumerKeySandbox="abcdefghijklmnop" consumerSecretSandbox="abcdefghijklmnopabcdefghijklmnop" />
                    </providers>
                    <!-- Hive SDK authentication settings: END -->
        </properties>

    <!-- Production (Service) configuration -->
    <properties>
    <!-- Hive SDK common settings omitted -->

                    <!-- Hive SDK authentication settings: START -->
                <providers>
                                    <!-- Log in with DMM (DMM) -->
                                <dmm appId="123456" developmentMode="service" redirectUri="app-redirect-url" consumerKey="abcdefghijklmnop" consumerSecret="abcdefghijklmnopabcdefghijklmnop" />
                    </providers>
<!-- Hive SDK authentication settings: END -->
</properties>

The hive_config.xml key list (Android, iOS) is as follows.

Key Value Required when
appId App identifier Always
developmentMode sandbox or service Always
consumerKey consumer key When service
consumerSecret consumer secret When service
consumerKeySandbox consumer key When sandbox
consumerSecretSandbox consumer secret When sandbox
redirectUri Redirect URL configured in the app Always
adult true or false For iOS

Consider the following for secretKey, clientId, and clientSecret configuration.

  • Configure the three values secretKey, clientId, and clientSecret through the setConfigurations() API.
  • Information configured through the setConfigurations() API is retained only in runtime memory, so you must call it every time the app starts.
  • Even if values are configured in the hive_config.xml file, values configured at runtime through the setConfigurations() API take priority and overwrite them.
  • For configuring confidential key values through the setConfigurations() API, refer to the example code below.

    using hive;
    
    // HiveConfigType.dmmSecretKey
    // HiveConfigType.dmmClientId
    // HiveConfigType.dmmClientSecret
    Configuration.setConfigurations(HiveConfigType.dmmSecretKey, "***");
    
    #include <HIVE_SDK_Plugin/HIVE_CPP.h>
    using namespace std;
    using namespace hive;
    
    // HiveConfigType::dmmSecretKey
    // HiveConfigType::dmmClientId
    // HiveConfigType::dmmClientSecret
    Configuration::setConfigurations(HiveConfigType::dmmSecretKey, "***");
    
    import com.hive.Configuration
    
    // Configuration.HiveConfigType.dmmSecretKey
    // Configuration.HiveConfigType.dmmClientId
    // Configuration.HiveConfigType.dmmClientSecret
    Configuration.setConfigurations(Configuration.HiveConfigType.dmmSecretKey, "***")
    
    import HIVEService
    
    // HiveConfigType.dmmSecretKey
    // HiveConfigType.dmmClientId
    // HiveConfigType.dmmClientSecret
    ConfigurationInterface.setConfigurations(.dmmSecretKey, "***")
    
    #import <HIVEService/HIVEService-Swift.h>
    
    // HiveConfigTypeDmmSecretKey
    // HiveConfigTypeDmmClientId
    // HiveConfigTypeDmmClientSecret
    [HIVEConfiguration setConfigurations: HiveConfigTypeDmmSecretKey value: @"***"];
    

Android DMM IdP configuration

Add the DMM login library by referring to Add Android IdP. Then configure Android DMM IdP in the following order.

  1. Configure redirectUri (scheme).

    redirect_uri is a custom scheme such as comXXX://auth, and you must submit it together when applying for clientId to receive DMM authentication approval before using it. Because this value is bound to clientId, using an unauthenticated value causes the DMM error E210019 (error_redirect_uri_unavailable) during login.

    Inject the redirect scheme in build.gradle.

    manifestPlaceholders += [hiveDmmRedirectScheme: "comXXX"]
    
  2. Configure Gradle dependencies and repository.

    Add the DMM Maven repository to dependencyResolutionManagement { repositories } in the root settings.gradle. Because Gradle repository declarations are not transitive, resolving the DMM SDK (link-id-sdk, AuthSDK) fails if it is not declared in the app build.

    maven { url 'https://repos-app.games.dmm.com/' }
    
    3. Implement by referring to Login/Logout.

iOS DMM IdP configuration

Add the DMM login library by referring to Add iOS IdP. Then implement by referring to Login/Logout.


Implementing DMM Billing

DMM is a payment method that lets users purchase products with charged DMM points. Payment requests and restoration flows follow the general IAP v4 purchase flow, but DMM-specific branches such as DMM point balance checks and point top-up guidance also operate. Therefore, even in the Windows DMM environment, keep the existing IAP v4 flow while also handling DMM point-based payment conditions.

Implementation steps

  1. Implement by referring to Billing > IAP v4 Initialization.
  2. Implement by referring to Billing > Product List Query and Purchase.
  3. Implement by referring to Receipt Verification.
  4. Consider the following for DMM login development.
    1. DMM billing is confirmed immediately without a separate payment window UI. If the purchase is in Pending state and no receipt is returned immediately after purchase, call IAPV4.restore to obtain the receipt again, and then proceed with verification and item grant processing. The overall flow for receipt verification and item grant processing after purchase is the same as other stores. For details, refer to Receipt Verification.
    2. DMM billing API calls require a valid management token onetime_token. For token lifetime, automatic refresh, and handling expiration, refer to DMM Login.
    3. DMM billing also supports multi-quantity purchases. Call IAPV4.purchase(marketPid, iapPayload, quantity, onIAPV4PurchaseCB) with the quantity parameter to purchase multiple units of the same product at once.

DMM points

Querying DMM point balance

Call IAPV4.getBalanceInfo to query the DMM point balance available to the user. Use it to proactively check the balance before purchase or to display the balance on the shop screen. The callback returns ResultAPI and the integer balance balance. getBalanceInfo can be used only for DMM billing in the PC Windows environment. Calling it in other markets returns the unsupported NOT_SUPPORTED result.

If the call succeeds, balance contains the currently available DMM point balance. If the call fails, check the failure reason with ResultAPI.

using hive;

IAPV4.getBalanceInfo((ResultAPI result, int balance) => {
    if (result.isSuccess()) {
        // balance: Available DMM point balance
    }
});
#include "HiveIAPV4.h"

FHiveIAPV4::GetBalanceInfo(FHiveIAPV4OnBalanceDelegate::CreateLambda([this](const FHiveResultAPI& Result, int32 Balance) {
    if (Result.IsSuccess()) {
        // Balance: Available DMM point balance
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

IAPV4::getBalanceInfo([=](ResultAPI const & result, int balance) {
    if (result.isSuccess()) {
        // balance: Available DMM point balance
    }
});

Guiding users to top up when DMM points are insufficient

If the point balance is insufficient during purchase, the purchase callback returns the IAPV4DmmInsufficientPointBalance result code. In this case, expose the DMM point top-up page in a browser from the app and guide the user to top up.

The DMM point top-up page URL is https://point.dmm.com/choice/pay?basket_service_type=freegame.

Caution

The top-up page URL above is provided by DMM and may change according to DMM policy. Check the latest URL and parameter values such as basket_service_type with DMM.