This repository has been archived on 2020-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
tdlib-fork/example/uwp
levlam c10ac96cc9 Various fixes.
GitOrigin-RevId: 3880e2fc5b8704f163817699ec1043f2f7a39b83
2018-03-14 17:43:00 +03:00
..
app Various fixes. 2018-03-14 17:43:00 +03:00
[Content_Types].xml UWP: build scripts 2018-02-28 21:19:33 +03:00
build.ps1 Various fixes. 2018-03-14 17:43:00 +03:00
extension.vsixmanifest Handle chatAction timeouts. 2018-03-13 20:48:08 +03:00
README.md Add C# example. 2018-03-12 02:38:07 +03:00
SDKManifest.xml Various fixes. 2018-03-06 19:27:52 +03:00

TDLib Universal Windows Platform example

This is an example of building TDLib SDK for Universal Windows Platform and an example of its usage from C#.

Building SDK

  • Download and install Microsoft Visual Studio 2015+ with Windows 10 SDK. We recommend to use the latest available versions of Microsoft Visual Studio and Windows 10 SDK.
  • Download and install CMake.
  • Install vcpkg or update it to the latest version using vcpkg update and following received instructions.
  • Install zlib and openssl for all UWP architectures using vcpkg:
C:\src\vcpkg> .\vcpkg.exe install openssl:arm-uwp openssl:x64-uwp openssl:x86-uwp zlib:arm-uwp zlib:x64-uwp zlib:x86-uwp
  • Download and install gperf. Add the path to gperf.exe to the PATH environment variable.
  • Download and install 7-Zip archiver, which is used by the build.ps1 script to create a TDLib.UWP Visual Studio Extension. Add the path to 7z.exe to the PATH environment variable. Alternatively build.ps1 supports compressing using WinRAR with option -compress winrar and compressing using zip with -compress zip.
  • Build TDLib using provided build.ps1 script (TDLib should be built 6 times for multiple platforms in Debug and Release configurations, so it make take few hours). Pass path to vcpkg.exe as -vcpkg-root argument:
powershell -ExecutionPolicy ByPass .\build.ps1 -vcpkg_root C:\src\vcpkg

If you need to restart the build from scratch, call .\build.ps -mode clean first.

  • Install Visual Studio Extension "TDLib for Universal Windows Platform" located at build-uwp\vsix\tdlib.vsix, which was created on the previous step by build.ps1 script.

Now TDLib can be freely used from any UWP project, built in Visual Studio.

Example of usage

The app/ directory contains a simple example of a C# application for Universal Windows Platform. Just open it with Visual Studio 2015 or 2017 and run.