Skip to content

Variable: ErrorCodes ​

ts
const ErrorCodes: object;

Error codes raised by Zalo Kit itself, found on the code property of a rejected promise. Errors coming from the Zalo SDK keep the numeric Zalo error code as a string, e.g. "-7008".

Type Declaration ​

NameTypeDefault valueDescription
INVALID_RESPONSE"INVALID_RESPONSE"'INVALID_RESPONSE'Zalo answered with an unexpected payload.
LOGIN_SUPERSEDED"LOGIN_SUPERSEDED"'LOGIN_SUPERSEDED'A newer login() call, or logout(), replaced this one.
NO_ACTIVITY"NO_ACTIVITY"'NO_ACTIVITY'No foreground activity / view controller to start the login from.
NOT_AUTHENTICATED"NOT_AUTHENTICATED"'NOT_AUTHENTICATED'No stored session. Call login() first.
NOT_CONFIGURED"NOT_CONFIGURED"'NOT_CONFIGURED'The native project is missing the Zalo app ID configuration.
ZALO_APP_INCOMPATIBLE"ZALO_APP_INCOMPATIBLE"'ZALO_APP_INCOMPATIBLE'Zalo app is installed but could not handle the login request.
ZALO_NOT_INSTALLED"ZALO_NOT_INSTALLED"'ZALO_NOT_INSTALLED'Zalo app is not installed and web fallback is disabled.

Example ​

ts
try {
  await login();
} catch (e: any) {
  if (e.code === ErrorCodes.ZALO_NOT_INSTALLED) {
    // ask the user to install Zalo
  }
}

Released under the MIT License.