搜索插件、代码仓与 APP 分类

插件详情v1.6.0

tdlib

TDLib 的 Flutter 插件。一个完整的 tdlib-tdjson 绑定包。

近 30 天下载
250
喜欢数
65
Pub 分数
60

安装插件

flutter pub add tdlib

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 插件,提供对 TDLib(Telegram 数据库库)的完整绑定,使 Flutter 应用能够使用原生 Telegram 功能。它通过 tdjson 提供对 Telegram 完整 API 的访问,让开发者能够构建具有用户身份验证、聊天管理、消息发送和媒体处理等功能的即时通讯应用。该包专为与 Flutter 无缝集成而设计,支持 Android 和 iOS 平台。非常适合希望在应用中嵌入类似 Telegram 的聊天体验而又无需从头开发的开发者。

适合场景

  • 构建 Telegram 客户端
  • 实现实时消息传递
  • 创建基于聊天的应用程序
  • 集成 Telegram 登录
  • 开发群组通信工具

主要特点

  • 完整的 TDLib 集成
  • 跨平台支持
  • 通过 Telegram 进行身份验证
  • 消息发送和接收
  • 媒体文件处理

适合对象

  • 开发 Telegram 客户端的开发者
  • 需要安全消息传递的应用程序
  • 需要 Telegram API 访问权限的项目
  • 移动聊天应用开发者

使用建议

  • 需要理解 TDLib
  • 大型二进制文件大小
  • 需要适当的状态管理
  • 有限的文档
  • 需要平台特定的设置

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

TDLib

Flutter Plugin for TDLib (Telegram Database Library) v1.8.15

Telegram Tdlib is a complete library for creating telegram clients, it also has a simple tdjson ready-to-use library to ease the integration with different programming languages and platforms.
This plugin is a complete tdlib-tdjson binding package to help you create your own Telegram clients.

See the example directory for the complete sample app.

Installation

Install the plugin by running the following command from the project root:

flutter pub add tdlib

Initialization

This plugin contains only Android tdlib-tdjson library. In case of other platforms usage you need to manually put the tdjson library in your project

  • for Windows:
  • for IOS and macOS support:
  • for web:
    • Copy all files in data/web-package to web folder in your project.
    • Point tdlib.js file in index.html:
      <!--add this between the <body> tags -->
      <script src="/tdlib.js" type="application/javascript"></script>
      

To initialize tdlib plugin, call the initialize method on the TdPlugin class.

Since this is an asynchronous operation, the main function can be modified to ensure initialization is complete before running the application.

The method accepts LIBTDJSON_PATH for windows platform or LIBTDJSON_NAME for IOS & macOS.

Import tdlib plugin:

import 'package:tdlib/tdlib.dart';

Next, within the main function, initialize TdPlugin:

// lib/main.dart

void main() async {
  await TdPlugin.initialize();
  runApp(MyApp());
}

Usage

Getting started with TDLib

所属分类

依赖

依赖清单 2 项

  • ffi^2.1.0
  • js^0.6.7

源码仓库

使用此插件的项目

暂无相关数据。