AuthorizationState

public indirect enum AuthorizationState : Codable, Equatable, FunctionResult, TDEnum, EquatableEnum

Represents the current authorization state of the client

  • TDLib needs TdlibParameters for initialization

    Declaration

    Swift

    case waitTdlibParameters
  • TDLib needs an encryption key to decrypt the local database

    • isEncrypted: True, if the database is currently encrypted

    Declaration

    Swift

    case waitEncryptionKey(isEncrypted: Bool)
  • TDLib needs the user’s phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication, or checkAuthenticationBotToken for other authentication options

    Declaration

    Swift

    case waitPhoneNumber
  • TDLib needs the user’s authentication code to authorize

    • codeInfo: Information about the authorization code that was sent

    Declaration

    Swift

    case waitCode(codeInfo: AuthenticationCodeInfo)
  • The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link

    • link: A tg:// URL for the QR code. The link will be updated frequently

    Declaration

    Swift

    case waitOtherDeviceConfirmation(link: String)
  • The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration

    • termsOfService: Telegram terms of service

    Declaration

    Swift

    case waitRegistration(termsOfService: TermsOfService)
  • The user has been authorized, but needs to enter a password to start using the application

    • passwordHint: Hint for the password; may be empty
    • hasRecoveryEmailAddress: True, if a recovery email address has been set up
    • recoveryEmailAddressPattern: Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent

    Declaration

    Swift

    case waitPassword(passwordHint: String, hasRecoveryEmailAddress: Bool, recoveryEmailAddressPattern: String)
  • The user has been successfully authorized. TDLib is now ready to answer queries

    Declaration

    Swift

    case ready
  • The user is currently logging out

    Declaration

    Swift

    case loggingOut
  • TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received

    Declaration

    Swift

    case closing
  • TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to -with error code 500. To continue working, one should create a new instance of the TDLib client

    Declaration

    Swift

    case closed