Skip to main content

tdlib 1.8.57 copy "tdlib: ^1.8.57" to clipboard
tdlib: ^1.8.57 copied to clipboard

Flutter Plugin for TDLib.A complete tdlib-tdjson binding package.

TDLib #

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

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 for a sample app.

Installation #

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

flutter pub add tdlib

Needs Flutter 3.38 or newer. The tdjson library for Android, iOS, macOS, Linux and Windows is downloaded and bundled by the package's build hook, builds are listed in hook/tdjson_sources.json.

To use your own tdjson build, set its path in your app's pubspec.yaml:

hooks:
  user_defines:
    tdlib:
      library_path: path/to/libtdjson.so

Web #

  • Copy all files in data/web_pkg 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>
    
  • Call await TdPlugin.initialize(); before using the plugin.

Usage #

import 'package:tdlib/td_lifecycle.dart';
import 'package:tdlib/td_runtime.dart' as td;

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final runtime = await td.TdRuntime.start();
  TdLifecycle(runtime);

  final client = runtime.createClient();
  client.authorizationStates.listen((state) {
    // send td.SetTdlibParameters on AuthorizationStateWaitTdlibParameters, ...
  });
  final td.User me = await client.invoke(const td.GetMe());
}

Getting started with TDLib

65
likes
0
points
969
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter Plugin for TDLib.A complete tdlib-tdjson binding package.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

archive, code_assets, crypto, ffi, flutter, flutter_web_plugins, hooks

More

Packages that depend on tdlib

Packages that implement tdlib