Skip to main content

TikTok Login — Android

Enable TikTok Login in your Android game by adding the TikTok SDK and a few config entries.

info

TikTok Login requires your game to be registered in the TikTok Developer Portal. Contact the Alogame team to get your tiktok_client_key — they will handle the portal registration and backend setup.


1. Add TikTok SDK dependency

In your app-level build.gradle:

app/build.gradle.kts
dependencies {
implementation("com.tiktok.open.sdk:tiktok-open-sdk-auth:2.2.0")
}
app/build.gradle (Groovy)
dependencies {
implementation 'com.tiktok.open.sdk:tiktok-open-sdk-auth:2.2.0'
}

2. Configure AndroidManifest.xml

Add the TikTok client key and the callback activity. Replace YOUR_TIKTOK_CLIENT_KEY with the key provided by the Alogame team.

AndroidManifest.xml
<application ...>

<meta-data
android:name="com.bytedance.sdk.openplatform.CLIENT_KEY"
android:value="YOUR_TIKTOK_CLIENT_KEY" />

<activity
android:name="com.tiktok.open.sdk.auth.AuthActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="YOUR_TIKTOK_CLIENT_KEY" />
</intent-filter>
</activity>

</application>

3. That's it

TikTok login is built into the SDK's login UI. Once the client key is configured, the TikTok button appears automatically when you call OegSdk.showLogin().

Kotlin
OegSdk.showLogin(object : AuthenticationCallBack {
override fun onLoginResult(result: WorkResult<AuthenticationInfo>, provider: String?) {
if (result.isSuccess()) {
val token = result.data?.token
val uuid = result.data?.uuid
}
}
override fun onRegisterResult(result: WorkResult<AuthenticationInfo>) = Unit
override fun onChangePassResult(result: WorkResult<Boolean>) = Unit
})

Troubleshooting

SymptomFix
TikTok button not showingConfirm the Alogame team has enabled TikTok for your game
Login fails silentlyCheck that CLIENT_KEY meta-data matches the key provided
ClassNotFoundException at runtimeAdd tiktok-open-sdk-auth to your app's dependencies
TikTok app opens but returns errorEnsure your app's package name and SHA-256 fingerprint are registered — ask the Alogame team
Blank page shown at api-sdk.oeg.vn/tiktok/callbackApp Links not verified — reinstall the app so Android re-verifies App Links at install time. Requires SDK v1.1.12+