CONFIGURATION
Configuration - Android
Sign-in redirect URIs
Sign-in methods that use an OAuth 2.0 client (SetOAuthClientId) send a redirect URI, and the server rejects the sign-in unless that URI is registered on the client. On Android, the URI is fixed per sign-in method and can't be changed from Unity:
| Sign-in method | Settings / call | Redirect URI to register |
|---|---|---|
| Device ID with OAuth 2.0 | SetOAuthClientId, no access token or social provider | app://xlogin.<applicationId> |
| Xsolla Login widget | XsollaLoginClient.Login / LoginSilently | app://xlogin.<applicationId> |
| Token refresh | XsollaLoginClient.RefreshToken, automatic refresh | app://xlogin.<applicationId> |
| Social provider's access token with OAuth 2.0 | SetOAuthClientId + SetSocialProvider, or XsollaLoginClient.LoginWithSocialAccount | https://login.xsolla.com/api/blank |
Device ID or social provider's access token without OAuth 2.0, your own access token (SetAccessToken) | — | None |
<applicationId> is your app's package name (Player Settings > Other Settings > Package Name), for example app://xlogin.com.example.mygame. If you ship builds under several package names, register the URI for each of them.
To register a URI, open your Login project in Publisher Account, go to Security > OAuth 2.0, and add it to the redirect URIs of the client whose ID you pass to SetOAuthClientId.
Custom Tabs / Trusted Web Activity browser selection
Use WebViewType.System or WebViewType.Trusted to enable browser provider controls for Custom Tabs / TWA. Configure provider blacklists, priority weights, and TWA fallback via advanced Android settings:
| Setting | Value | Description |
|---|---|---|
| SetUserBlacklistedProviders | HashSet<string> | Exclude specific Custom Tabs/TWA providers from being used. |
| SetInternalProviderBlacklistEnabled | bool | Apply the SDK's internal provider blacklist in addition to user-provided exclusions. |
| SetUserBlacklistedTWAProviders | HashSet<string> | Exclude specific TWA providers; lower priority than SetUserBlacklistedProviders. |
| SetInternalTWAProviderBlacklistEnabled | bool | Apply the SDK's internal TWA provider blacklist in addition to user-provided exclusions. |
| SetUserProviderPriorityWeights | Dictionary<string, float> | Adjust provider selection priority via per-package weights (higher weight = higher priority). |
| SetFallbackToFirstAvailableTWAProvider | bool | If requested provider lacks TWA support, fall back to the first available TWA-compatible provider. |
var advanced = new XsollaClientSettings.AdvancedSettingsAndroid()
.SetUserBlacklistedProviders(new HashSet<string>{ "com.android.chrome" })
.SetInternalProviderBlacklistEnabled(true)
.SetUserBlacklistedTWAProviders(new HashSet<string>{ "com.custom.browser" })
.SetInternalTWAProviderBlacklistEnabled(true)
.SetUserProviderPriorityWeights(new Dictionary<string, float>{{ "com.google.android.apps.chrome", 2.0f }})
.SetFallbackToFirstAvailableTWAProvider(true);
var settings = XsollaStoreClientSettings.Builder.Create()
.SetWebViewType(XsollaStoreClientSettings.WebViewType.Trusted)
.SetAdvancedSettingsAndroid(advanced)
.Build();
Cancellation Reason Querying
When enabled, the SDK distinguishes between a user closing the payment screen without paying (Cancelled) and a payment that was attempted but failed (reported as an error). When disabled (default), both cases report Cancelled.
var advanced = new XsollaClientSettings.AdvancedSettingsAndroid()
.SetQueryCancellationReasonEnabled(true);
var settings = XsollaStoreClientSettings.Builder.Create()
.SetAdvancedSettingsAndroid(advanced)
.Build();
External browser app relaunch
When the app is killed during a payment flow in an external browser, the return-to-app button in Pay Station silently fails by default. Enable this setting so the redirect brings the user back to the app instead. Requires WebViewType.External.
var advanced = new XsollaClientSettings.AdvancedSettingsAndroid()
.SetRedirectAppRelaunchEnabled(true);
var settings = XsollaStoreClientSettings.Builder.Create()
.SetWebViewType(XsollaStoreClientSettings.WebViewType.External)
.SetAdvancedSettingsAndroid(advanced)
.Build();
WebView splash screen
Set a splash screen image displayed in the Android WebView while Pay Station loads:
var settings = XsollaStoreClientSettings.Builder.Create()
//..
.SetWebViewSplashScreenImage("path/to/splash.png")
.SetWebViewSplashScreenDrawableIdAndroid(0x7f080001) // your Android drawable resource ID
.Build();
SetWebViewSplashScreenImage: File path to the splash screen image.SetWebViewSplashScreenDrawableIdAndroid: Android drawable resource ID for the splash screen image.