Android
The purpose of this article is to describe how to set up Discord authentication so that your game can be logged in through the Discord channel using the Player Network login authentication service.
Prerequisites
1. Configuring the application on the Discord Developer Platform
1.1. Create an Application
- Register and authenticate your account on the Discord official website
- Go to the Developer Platform and click New Application

- Enter your application name and click Create
- On the General Information page, obtain the APPLICATION ID

- Configure the Discord App ID in INTLConfig.ini
1.2. Apply for SDK Access
- Go to the Developer Platform
- Click Games - Social SDK, fill out the form, and submit


Before the official launch of your game, notify the Discord team in advance to enable production permissions.
1.3. Configure OAuth2
- Click OAuth2 and turn on the PUBLIC CLIENT option

- Configure Redirects:
- Android/iOS:
discord-{YOUR_APP_ID}:/authorize/callback - PC:
http://127.0.0.1/callback - Web:
https://common-web.intlgame.com/jssdk/discordlogincallback.html,https://test-common-web.intlgame.com/jssdk/discordlogincallback.html
- Android/iOS:

For multi-store channel packs:
Support for multi-store channel packages requires a separate REDIRECT_URL_SCHEME.An App ID supports 10 redirect URLs (about 4 multi-store channel packs).If the game requires more than 4 multi-store channel packs, please request more App IDs.To use multiple application IDs, the game requires Configure multiple application IDs in INTLConfig.ini and Register multiple Discord applications on Player Network.
For mobile platforms, if the app needs to redirect back to the game, DeepLink must be configured: add the redirect URL under General Information → Deep Link URL

1.4. Configure Rich Presence Assets
- Click Rich Presence
- Click Add Image(s) to upload image assets

- Obtain Player Network console login account.
- Create a new project for your game, or join an existing project.
- Download SDK.
- Integrate SDK.
- Add Discord as the login authentication method for the service in the Player Network Console.
Step 1:Configure the SDK for Discord Login
Since the Discord SDK is only compatible with minSdkVersion >=23 or higher, running it on Android 6.0 or earlier may cause problems.Please set minSdkVersion >= 23 for the game.
- In the
AndroidManifestfile, make sure the required permissions are added.Discord requires network access.
<uses-permission android:name="android.permission.INTERNET"/>
- Open your project's INTLConfig.ini file:
[Android LifeCycle]
LIFECYCLE = Discord
[Discord]
DISCORD_APP_ID = {INTL_DISCORD_APP_ID}
- Add Discord to
LIFECYCLE.For more information, please see SDK Environment. - Replace
{INTL_DISCORD_APP_ID}with the Discord App ID for the game.
- Complete the Gradle configuration.
- Unity
- Unreal Engine
In mainTemplate.gradle, add DISCORD_APP_ID.
android {
defaultConfig {
manifestPlaceholders = [
"DISCORD_APP_ID":"{INTL_DISCORD_APP_ID}"
]
}
}
Since Discord requires that the minSdkVersion of an application be at least 23, the UE project must update the minSdkVersion configuration to at least 23 when it is packaged.

In INTLCore_UPL.xml, add DISCORD_APP_ID.
<buildGradleAdditions>
<insert>
<![CDATA[
android{
defaultConfig {
manifestPlaceholders = [
"DISCORD_APP_ID":"{INTL_DISCORD_APP_ID}"
]
}
}
]]>
</insert>
</buildGradleAdditions>
- Replace
{INTL_DISCORD_APP_ID}with the Discord App ID for the game.
Step 2:Add Discord Login
Discord does not require an application to be installed before logging in.If the app is installed, it will be opened for login; otherwise, login will be opened in the browser.
- Register login-related callbacks.
- Unity
- Unreal Engine
// Add callbacks
public void AddAuthObserver()
{
INTLAPI.AddAuthResultObserver(OnAuthResultEvent);
}
// Remove callbacks
public void RemoveAuthObserver()
{
INTLAPI.RemoveAuthResultObserver(OnAuthResultEvent);
}
// Process the INTLAuthResult callback
public void OnAuthResultEvent(INTLAuthResult AuthResult)
{
Debug.Log($"MethodID: {AuthResult.MethodId}");
string methodTag = "";
switch (AuthResult.MethodId)
{
case (int)INTLMethodID.INTL_AUTH_LOGIN:
methodTag = "Login";
break;
case (int)INTLMethodID.INTL_AUTH_BIND:
methodTag = "Bind";
break;
case (int)INTLMethodID.INTL_AUTH_AUTOLOGIN:
methodTag = "AutoLogin";
break;
case (int)INTLMethodID.INTL_AUTH_QUERY_USER_INFO:
methodTag = "QueryUserInfo";
break;
case (int)INTLMethodID.INTL_AUTH_GET_AUTH_RESULT:
methodTag = "GetAuthResult";
break;
}
}
C++ Event Handling (above v1.15)
//configure callback
FINTLAuthEvent authEvent;
authEvent.AddUObject(this, &OnAuthResult_Implementation);
UINTLSDKAPI::SetAuthResultObserver(authEvent);
// Remove callbacks
UINTLSDKAPI::GetAuthResultObserver().Clear();
void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}
Unreal Event Handling
void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}
- Call the
AutoLogininterface to log in automatically.
- Unity
- Unreal Engine
INTLAPI.AutoLogin();
UINTLSDKAPI::AutoLogin();
- If automatic login fails, call the
Logininterface to let the player log in manually.
- Unity
- Unreal Engine
INTLAPI.Login(INTLChannel.Discord, "identify", "");
INTLAPI.Login(INTLChannel.Discord, "identify,relationships.read,activities.write", ""); //Friend functions
UINTLSDKAPI::Login(EINTLLoginChannel::Discord, "identify", "");
UINTLSDKAPI::Login(EINTLLoginChannel::Discord, "identify,relationships.read,activities.write", ""); //Friend functions
- Synchronize client authentication status with the game backend and wait for the final verification result.
Step 3: Acceptance testing for login functionality
Search for the keyword "AuthResult" in the Player Network SDK logs to confirm whether the channel name and OpenID are returned correctly.If correct, it means the integration configuration is successful, and login functionality has been successfully added.
If you encounter problems during the integration process, please refer to Frequently Asked Questions.