{"id":32151866,"url":"https://github.com/swiftgram/tdlibframework","last_synced_at":"2026-03-04T13:03:19.762Z","repository":{"id":37449395,"uuid":"383924354","full_name":"Swiftgram/TDLibFramework","owner":"Swiftgram","description":"TDLib for iOS, macOS, watchOS, tvOS and visionOS packed in XCFramework and SPM.","archived":false,"fork":false,"pushed_at":"2025-10-17T10:02:53.000Z","size":26153,"stargazers_count":22,"open_issues_count":3,"forks_count":16,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-21T10:53:25.919Z","etag":null,"topics":["flutter-ios","ios","macos","swift","tdlib","tdlib-flutter","tdlib-swift","telegram","tvos","visionos","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Swiftgram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-07-07T21:05:28.000Z","updated_at":"2025-10-17T10:02:50.000Z","dependencies_parsed_at":"2024-02-20T11:45:49.552Z","dependency_job_id":"bea673b0-b79f-4f07-8b43-acf51eec46e5","html_url":"https://github.com/Swiftgram/TDLibFramework","commit_stats":null,"previous_names":[],"tags_count":284,"template":false,"template_full_name":null,"purl":"pkg:github/Swiftgram/TDLibFramework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftgram%2FTDLibFramework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftgram%2FTDLibFramework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftgram%2FTDLibFramework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftgram%2FTDLibFramework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Swiftgram","download_url":"https://codeload.github.com/Swiftgram/TDLibFramework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftgram%2FTDLibFramework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280248570,"owners_count":26297925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter-ios","ios","macos","swift","tdlib","tdlib-flutter","tdlib-swift","telegram","tvos","visionos","watchos"],"created_at":"2025-10-21T10:54:22.818Z","updated_at":"2025-10-21T10:54:23.763Z","avatar_url":"https://github.com/Swiftgram.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TDLibFramework\n\n[![CI](https://github.com/Swiftgram/TDLibFramework/actions/workflows/ci.yml/badge.svg)](https://github.com/Swiftgram/TDLibFramework/actions/workflows/ci.yml)\n\nProject contains pre-compiled [TDLib](https://github.com/tdlib/td) binary for iOS, macOS, watchOS, tvOS, visionOS and simulators in `.xcframework` bundle.\n\nIf you're looking for pure Swift library, check out [TDLibKit](https://github.com/Swiftgram/TDLibKit)\n\n## Installation\n\n### Xcode (SPM)\n\n1. Install latest Xcode\n2. Add `https://github.com/Swiftgram/TDLibFramework` as SPM dependency in `Project \u003e Swift Packages`.\nThis could take a while cause it downloads ~300mb zip file with xcframework.\n3. Add `TDLibFramework` as your target dependency.\n4. Code!\n\n### Cocoapods \u0026 Flutter\n\nSee the [docs](docs/COCOAPODS-and-FLUTTER.md)\n\n## Usage\n\nSimple examples can be found in [Tests](Tests) directory.\n\n### Create client\n\n```swift\nlet clientId: Int32 = td_create_client_id()\n```\n\n### Make request object\n\n```swift\nlet request = [\"@type\": \"getTextEntities\", \"text\": \"@telegram /test_command https://telegram.org telegram.me\", \"@extra\": [\"5\", 7.0, \"\\\\u00e4\"]] as [String: Any]\n```\n\n### JSON Serialization and Deserialization\n\nSmall example for helper functions you will need to talk with TDLib\n\n```swift\nfunc dictToJSONString(_ dictionary: [String: Any]) -\u003e String {\n    let dictionaryData = try! JSONSerialization.data(withJSONObject: dictionary)\n    return String(data: dictionaryData, encoding: .utf8)!\n}\n\nfunc JSONStringToDict(_ string: String) -\u003e [String: Any] {\n    let responseData = string.data(using: .utf8)!\n    return try! JSONSerialization.jsonObject(with: responseData, options: .allowFragments) as! [String: Any]\n}\n```\n\n### Synchronious requests\n\nOnly for methods with \"[Can be called synchronously](https://github.com/tdlib/td/blob/73d8fb4b3584633b0ffde97a20bbff6602e7a5c4/td/generate/scheme/td_api.tl#L4294)\" in docs\n\n```swift\nif let res = td_execute(dictToJSONString(request)) {\n    let responseString = String(cString: res)\n    let responseDict = JSONStringToDict(responseString)\n    print(\"Response from TDLib \\(responseDict)\")\n}\n```\n\n### Async requests\n\n```swift\nlet request = [\n    \"@type\": \"setTdlibParameters\",\n    \"api_hash\": \"5e6d7b36f0e363cf0c07baf2deb26076\",\n    \"api_id\": 287311,\n    \"application_version\": \"1.0\",\n    \"database_directory\": \"tdlib\",\n    \"database_encryption_key\": nil,\n    \"device_model\": \"iOS\",\n    \"enable_storage_optimizer\": true,\n    \"files_directory\": \"\",\n    \"ignore_file_names\": true,\n    \"system_language_code\": \"en\",\n    \"system_version\": \"Unknown\",\n    \"use_chat_info_database\": true,\n    \"use_file_database\": true,\n    \"use_message_database\": true,\n    \"use_secret_chats\": true,\n    \"use_test_dc\": false,\n] as [String: Any]\n// Send request\ntd_send(clientId, dictToJSONString(request))\n\n// Block thread and wait for response (not more 5.0 seconds)\nif let response = td_receive(5.0) {\n   let responseString = String(cString: res)\n   let responseDict = JSONStringToDict(responseString)\n   print(\"Async response from TDLib \\(responseDict)\")\n}\n```\n\nClose client on exit\n\n```swift\ntd_send(clientId, dictToJSONString([\"@type\": \"Close\"] as [String: String]))\n```\n\n## Releases\n\nYou can find latest releases at [Releases](https://github.com/Swiftgram/TDLibFramework/releases) page.\n\n## Build\n\nYou can find more about build process in [Github Actions](.github/workflows/ci.yml) file.\n\n## Contribute\n\nEditing `builder/Project.swift` requires [tuist](https://tuist.io/). See [installation](https://docs.tuist.io/documentation/tuist/installation) instructions for more info.\n\nTuist's main distribution channel is the [mise](https://mise.jdx.dev/) tool. Check their [installation](https://mise.jdx.dev/getting-started.html) steps as well\n\n```shell\nmise install tuist\n```\n\n```shell\ncd builder\ntuist edit\n```\n\n## Credits\n\n- Anton Glezman for [Build Guide](https://github.com/modestman/tdlib-swift) and basic implementation\n- Telegram Team for [TDLib](https://github.com/tdlib/td)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftgram%2Ftdlibframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftgram%2Ftdlibframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftgram%2Ftdlibframework/lists"}