TdlibParameters

public struct TdlibParameters : Codable, Equatable, FunctionResult

Contains parameters for TDLib initialization

  • If set to true, the Telegram test environment will be used instead of the production environment

    Declaration

    Swift

    public let useTestDc: Bool
  • The path to the directory for the persistent database; if empty, the current working directory will be used

    Declaration

    Swift

    public let databaseDirectory: String
  • The path to the directory for storing files; if empty, database_directory will be used

    Declaration

    Swift

    public let filesDirectory: String
  • If set to true, information about downloaded and uploaded files will be saved between application restarts

    Declaration

    Swift

    public let useFileDatabase: Bool
  • If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database

    Declaration

    Swift

    public let useChatInfoDatabase: Bool
  • If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database

    Declaration

    Swift

    public let useMessageDatabase: Bool
  • If set to true, support for secret chats will be enabled

    Declaration

    Swift

    public let useSecretChats: Bool
  • Application identifier for Telegram API access, which can be obtained at https://my.telegram.org

    Declaration

    Swift

    public let apiId: Int32
  • Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org

    Declaration

    Swift

    public let apiHash: String
  • IETF language tag of the user’s operating system language; must be non-empty

    Declaration

    Swift

    public let systemLanguageCode: String
  • Model of the device the application is being run on; must be non-empty

    Declaration

    Swift

    public let deviceModel: String
  • Version of the operating system the application is being run on; must be non-empty

    Declaration

    Swift

    public let systemVersion: String
  • Application version; must be non-empty

    Declaration

    Swift

    public let applicationVersion: String
  • If set to true, old files will automatically be deleted

    Declaration

    Swift

    public let enableStorageOptimizer: Bool
  • If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name

    Declaration

    Swift

    public let ignoreFileNames: Bool
  • Contains parameters for TDLib initialization

    Declaration

    Swift

    public init(useTestDc: Bool, databaseDirectory: String, filesDirectory: String, useFileDatabase: Bool, useChatInfoDatabase: Bool, useMessageDatabase: Bool, useSecretChats: Bool, apiId: Int32, apiHash: String, systemLanguageCode: String, deviceModel: String, systemVersion: String, applicationVersion: String, enableStorageOptimizer: Bool, ignoreFileNames: Bool)

    Parameters

    useTestDc

    If set to true, the Telegram test environment will be used instead of the production environment

    databaseDirectory

    The path to the directory for the persistent database; if empty, the current working directory will be used

    filesDirectory

    The path to the directory for storing files; if empty, database_directory will be used

    useFileDatabase

    If set to true, information about downloaded and uploaded files will be saved between application restarts

    useChatInfoDatabase

    If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database

    useMessageDatabase

    If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database

    useSecretChats

    If set to true, support for secret chats will be enabled

    apiId

    Application identifier for Telegram API access, which can be obtained at https://my.telegram.org

    apiHash

    Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org

    systemLanguageCode

    IETF language tag of the user’s operating system language; must be non-empty

    deviceModel

    Model of the device the application is being run on; must be non-empty

    systemVersion

    Version of the operating system the application is being run on; must be non-empty

    applicationVersion

    Application version; must be non-empty

    enableStorageOptimizer

    If set to true, old files will automatically be deleted

    ignoreFileNames

    If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name

  • Undocumented

    Declaration

    Swift

    static func create(useTestDc: Bool = false,
                       databaseDirectory: String,
                       filesDirectory: String,
                       useFileDatabase: Bool = true,
                       useChatInfoDatabase: Bool = true,
                       useMessageDatabase: Bool = true,
                       useSecretChats: Bool = false,
                       apiId: Int32,
                       apiHash: String,
                       systemLanguageCode: String = "en",
                       deviceModel: String = "iPhone",
                       systemVersion: String = "12.1",
                       applicationVersion: String = "1.0",
                       enableStorageOptimizer: Bool = false,
                       ignoreFileNames: Bool = false) -> TdlibParameters