Skip to content

Real-name verification and anti-addiction

Real-name verification and anti-addiction lets the game determine whether the current player can continue playing, and whether the game should restrict, prompt, or exit based on the state returned by the platform. The SDK only provides state; the game remains responsible for prompts, save handling, exit behavior, or account switching.

IGP supports two handling modes: platform-side launch blocking, or in-game sign-in and real-name verification hosted by the game. If the product goal is to keep users inside the game, use the in-game real-name verification mode: the game requests a verification entry from the SDK and opens it in an in-game WebView. If the user is not signed in, the page handles IGP sign-in or registration first; after sign-in, users who are not verified continue directly to the real-name form. The game only hosts the WebView and handles the callback; it does not receive identity credentials, real names, or ID numbers.

  • Launch blocking: use this when the platform should complete real-name verification and anti-addiction checks before the game starts. After this mode is selected in the developer console, users who do not meet the requirements are blocked before entering the game, so the game usually does not need to open a real-name WebView.
  • In-game real-name verification: use this when users should stay inside the game while signing in, registering, and completing real-name verification. The game reads state after startup; when verification is required, it requests the verification entry from the SDK, opens it in an in-game WebView, and refreshes state after the completion callback.

Choose one mode per project in the developer console. Do not design two conflicting blocking flows in the same release. The code examples below focus on in-game real-name verification. If the project uses launch blocking, the game-side focus is reading state after normal startup and showing prompts, not opening the real-name WebView itself.

EngineStatusNotes
UnityPreviewReads state, listens to changes, and hosts the in-game real-name verification flow through the optional compliance module.
GameMakerPreviewThe GameMaker Windows build provides current state, refresh, and event queue support, suitable for launch blocking and state display.
GodotNot supportedGodot currently has no real-name verification and anti-addiction entry point.
  • Startup and connection is complete.
  • The local IGP desktop client is available.
  • Real-name verification and anti-addiction is enabled in the IGP developer console, with either launch blocking or in-game real-name verification selected.
  • Unity projects must additionally install cn.indiegp.sdk.unity.compliance.
  • The game must handle non-playable states, such as showing a prompt, returning to the main menu, or exiting.

Unity requires the optional cn.indiegp.sdk.unity.compliance package in addition to the main package. The example below is for in-game real-name verification. If the project uses launch blocking, Unity usually only needs state refresh and block-prompt handling.

using UnityEngine;
using IGP.UnitySDK;
using IGP.UnitySDK.Compliance;
public sealed class IGPComplianceDriver : MonoBehaviour
{
[SerializeField] private IGPRuntimeManager runtimeManager;
private System.IDisposable subscription;
private void OnEnable()
{
subscription = IGPCompliance.SubscribeAntiAddictionEvents(
runtimeManager,
HandleComplianceEvent);
}
private void OnDisable()
{
subscription?.Dispose();
}
public async void Refresh()
{
var ev = await IGPCompliance.RefreshAntiAddictionEventAsync(runtimeManager);
HandleComplianceEvent(ev);
}
public async void OpenAccountVerification()
{
var webSession = await runtimeManager.CreateAntiAddictionRealNameWebSessionAsync();
OpenGameWebView(webSession.url);
}
public async void OnWebViewNavigation(string url)
{
if (!url.StartsWith("igp://anti-addiction/real-name-complete"))
{
return;
}
CloseGameWebView();
var ev = await IGPCompliance.RefreshAntiAddictionEventAsync(runtimeManager);
HandleComplianceEvent(ev);
}
private void HandleComplianceEvent(IGPAntiAddictionComplianceEvent ev)
{
if (ev.action == IGPAntiAddictionComplianceActions.Block)
{
// Show a prompt based on ev.reasonMessage, or return to the main menu.
}
}
private void OpenGameWebView(string url) {}
private void CloseGameWebView() {}
}
EngineCheckpoint
UnityIn launch blocking mode, users who do not meet the requirements do not enter the main game flow; in in-game real-name verification mode, the in-game WebView opens the verification entry when needed and refreshes state after completion.
GameMakeranti_addiction_status can be read, and anti_addiction_state_changed is received after refresh. If launch blocking is used, confirm that users who do not meet the requirements do not enter the main game flow.
GodotReal-name verification and anti-addiction is not validated currently.
  • Unity cannot find IGPCompliance: confirm the real-name verification and anti-addiction module package is installed.
  • State is empty or remains default: first confirm the IGP desktop client connection succeeded.
  • Users should stay in game: open the SDK-returned url in the in-game WebView instead of handing it to the system browser.
  • A block state is received: handle it according to the returned reason; do not hardcode bypass logic in the SDK layer.
  • GameMaker has no state change event: confirm igp_update() is called and the event queue is polled.