TDLib

TDLib Swift 开发示例

先将 TDLib 安装到示例目录,再在 Xcode 中构建 Swift macOS 项目,查阅 JSON 接口。

GetTGAPI 编辑团队更新于
TDLib 文档核对日期

来源版本 a94b83d67ab4 · TDLib contributors · BSL-1.0

依据官方资料整理,由 GetTGAPI 独立维护。 文档目录与术语表 →

本页内容
  1. 开始之前
  2. TDLib Swift macOS 示例

开始之前

这是 macOS Swift 示例。若要用于 iPhone 或其他 Apple 设备,先阅读 Apple 平台构建说明并选择正确 SDK;不能直接把 macOS 动态库放入 iOS 应用。

TDLib Swift macOS 示例

应先构建 TDLib,并安装到本地子目录 td/:

cd <path to TDLib sources>
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../example/swift/td ..
cmake --build . --target install

然后可以使用最新 Xcode 打开并构建示例。

所有可用类和方法的说明见 td_json_client 和 td_api 文档。

继续阅读 TDLib 总览与构建。需要应用凭证时,可参考 API ID 与 Hash 申请流程;申请遇到 ERROR,可通过 GetTGAPI 客服 沟通。

原文许可与归属 · BSL-1.0

TDLib contributors · 完整许可文件

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.