Error Codes
Most SDK callbacks that can fail (AuthenticationCallBack, UserCallBack, OTP results, and purchase verification) carry a numeric error code alongside a human-readable message — e.g. result.getError().getCode() / error.code.
These codes come from SdkErrorCode (Android: vn.oeg.sdk.v2.core.validation.domain.SdkErrorCode; iOS: SdkErrorCode) and are identical on Android and iOS — the same numeric value always means the same thing on both platforms.
These are the SDK's own codes, not BillingClient.BillingResponseCode (which only ranges roughly -3 to 12). If you see a 4-digit code like 2007, it's from this table, not from Billing directly.
Validation Errors (1000–1999)
Input the game passed to the SDK failed a local check — these never reach the network.
| Code | Constant | Meaning |
|---|---|---|
| 1001 | INVALID_USERNAME | Username missing or fails format rules |
| 1002 | INVALID_PASSWORD | Password missing or too short/long |
| 1003 | INVALID_FULLNAME | Full name fails validation |
| 1004 | INVALID_EMAIL | Email missing or malformed |
| 1005 | INVALID_PHONE | Phone number missing or malformed |
| 1006 | INVALID_PRODUCT_ID | Product ID missing or blank |
| 1007 | INVALID_PURCHASE_TOKEN | Purchase token missing or blank |
| 1008 | INVALID_SERVER_ID | Server ID missing or blank |
| 1009 | INVALID_ROLE_ID | Role/character ID missing or blank |
| 1010 | PHONE_NOT_SET | Action requires a phone number on the account, but none is set |
| 1011 | INVALID_OTP | OTP code missing or blank |
| 1012 | INVALID_ACCESS_TOKEN | Access token/UUID missing — usually means "not logged in" at the call site |
Domain Errors (2000–2999)
A business-logic condition, not a network failure.
| Code | Constant | Meaning |
|---|---|---|
| 2001 | NOT_LOGGED_IN | Action requires a logged-in user |
| 2002 | SESSION_EXPIRED | Session/token expired — prompt re-login |
| 2003 | ACCOUNT_MERGE_REQUIRED | Guest account must be merged before continuing |
| 2004 | GUEST_NOT_ALLOWED | Action isn't available for guest/PlayNow accounts |
| 2005 | ALREADY_PENDING | Request already in progress (e.g. account deletion already requested) |
| 2006 | NO_PENDING_DELETION | No pending account-deletion request to cancel |
| 2007 | PURCHASE_CANCELLED | User dismissed/declined the Google Play (or StoreKit) purchase dialog — not an error to alert on, just log/ignore |
| 2008 | PURCHASE_ALREADY_OWNED | Item already owned — the SDK consumes it automatically and retries |
Network Errors (3000–3999)
HTTP/connectivity failures while talking to the Alogame backend.
| Code | Constant | Meaning |
|---|---|---|
| 3001 | NETWORK_TIMEOUT | Request timed out |
| 3002 | NETWORK_UNAVAILABLE | No connectivity / host unreachable |
| 3003 | SERVER_ERROR | Backend returned 5xx |
| 3004 | CLIENT_ERROR | Backend returned a 4xx not covered by a more specific code below |
| 3401 | UNAUTHORIZED | Backend returned HTTP 401 |
| 3403 | FORBIDDEN | Backend returned HTTP 403 |
| 3404 | NOT_FOUND | Backend returned HTTP 404 |
| 3409 | CONFLICT | Backend returned HTTP 409 (e.g. duplicate transaction — see Payment → Duplicate Transaction) |
| 3999 | UNEXPECTED_ERROR | Uncaught exception — check message for detail |
OegSdk/AlogameSdk facade uses a separate, smaller code setThe older com.github.alo-game:alogame-sdk-android legacy facade (OegSdk.showPayment, IabCallBack) predates this table and uses its own ad hoc codes (401, 1001 for user-cancel, 3000 general) — see Payment → Error Codes. Those two numbering schemes are different; check which API you're calling before looking up a code.