Skip to content

Instantly share code, notes, and snippets.

@fabianeichinger
Last active February 14, 2019 12:22
Show Gist options
  • Save fabianeichinger/94bf7e7ce9af4b5c1dacfd82456367aa to your computer and use it in GitHub Desktop.
Save fabianeichinger/94bf7e7ce9af4b5c1dacfd82456367aa to your computer and use it in GitHub Desktop.

Compiling Telegram for iOS

Tested only in a simulator.

Compiles the official Telegram iOS Repo on Github as of 9bd7c529b2212b1195d21346bbd7b8c04dfdb8ae.

You'll need an API Key / Hash pair to build a working client.

  1. Clone Telegram repo
$ git clone --recursive https://github.com/peter-iakovlev/Telegram
  1. cd into repo
$ cd Telegram
  1. Create stub for build version scripts
$ mkdir tools
$ echo '#!/bin/bash -c true' > tools/bump_build_number.sh
$ echo '#!/bin/bash -c true' > tools/sync_watch_version.sh
  1. Open the Xcode workspace
$ open Telegram.xcworkspace
  1. Right-click the top-most Telegraph workspace and create a new Header File called config.h with this content:
#ifndef config_h
#define config_h

#define SETUP_API_ID(v) v = <YOUR API ID>;
#define SETUP_API_HASH(v) v = @"<YOUR API HASH>";

#endif /* config_h */
  1. Open LegacyDatabase > TGShareContextSignal.m and replace
#import "../../config.h"

with

#import "../config.h"
@sbhmajd
Copy link

sbhmajd commented Feb 21, 2018

Not working anymore,, any other solution?

MTProtoKit using AFNetworking,, old classes AFHTTP.... and AFURLRequest....
Now AFNetworking has AFURLSession....

This one issue of many xD

Moved to TelegramSwift for Mac,,, it is working as Usage description

@yingmu52
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment