TelegramMessenger/Telegram-iOS
Telegram-iOS
Missing license — unclear to depend on
worst of 4 axesno license — legally unclear
no license — can't legally use code
Documented and popular — useful reference codebase to read through.
no license — can't legally use code
- ✓Last commit 3d ago
- ✓2 active contributors
- ✓CI configured
Show 4 more →Show less
- ✓Tests present
- ⚠Small team — 2 contributors active in recent commits
- ⚠Concentrated ownership — top contributor handles 54% of recent commits
- ⚠No license — legally unclear to depend on
What would change the summary?
- →Use as dependency Concerns → Mixed if: publish a permissive license (MIT, Apache-2.0, etc.)
- →Fork & modify Concerns → Mixed if: add a LICENSE file
- →Deploy as-is Concerns → Mixed if: add a LICENSE file
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Great to learn from" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/telegrammessenger/telegram-ios)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/telegrammessenger/telegram-ios on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: TelegramMessenger/Telegram-iOS
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/TelegramMessenger/Telegram-iOS shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Missing license — unclear to depend on
- Last commit 3d ago
- 2 active contributors
- CI configured
- Tests present
- ⚠ Small team — 2 contributors active in recent commits
- ⚠ Concentrated ownership — top contributor handles 54% of recent commits
- ⚠ No license — legally unclear to depend on
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live TelegramMessenger/Telegram-iOS
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/TelegramMessenger/Telegram-iOS.
What it runs against: a local clone of TelegramMessenger/Telegram-iOS — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in TelegramMessenger/Telegram-iOS | Confirms the artifact applies here, not a fork |
| 2 | Default branch master exists | Catches branch renames |
| 3 | Last commit ≤ 33 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of TelegramMessenger/Telegram-iOS. If you don't
# have one yet, run these first:
#
# git clone https://github.com/TelegramMessenger/Telegram-iOS.git
# cd Telegram-iOS
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of TelegramMessenger/Telegram-iOS and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "TelegramMessenger/Telegram-iOS(\\.git)?\\b" \\
&& ok "origin remote is TelegramMessenger/Telegram-iOS" \\
|| miss "origin remote is not TelegramMessenger/Telegram-iOS (artifact may be from a fork)"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 33 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~3d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/TelegramMessenger/Telegram-iOS"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
Telegram-iOS is the official Telegram messenger application for iPhone and iPad, written primarily in Swift with performance-critical components in C/C++. It implements the complete MTProto protocol for secure messaging, including voice calls, video calls, channels, groups, and file transfers, with offline-first architecture and strong end-to-end encryption support. Monorepo structure: main app code in Telegram/ with app extensions in Telegram/NotificationService/, Telegram/Share/, Telegram/SiriIntents/. Build system in build-system/ (Python-based Bazel configuration generation via Make.py). Telegram/BUILD defines the primary app target. Heavy use of app groups and extensions for notification handling, document sharing, and Siri integration.
👥Who it's for
iOS developers maintaining or contributing to the Telegram app, security researchers studying encrypted messaging implementations, and developers building custom Telegram clients who need reference implementations. Also relevant for developers working on app extensions (notification service, share extension, Siri intents).
🌱Maturity & risk
Production-ready and actively maintained. This is the official Telegram iOS app used by hundreds of millions of users. The codebase is large (85MB Swift alone), has comprehensive CI/CD via GitHub Actions and GitLab CI, uses Bazel-based build system, and receives regular updates. High stability expectations with security audits.
High complexity due to cryptographic implementations (MTProto), tight coupling to Telegram's backend services, and massive scope requiring careful dependency management. Risk of breaking changes when Telegram server protocol evolves. Heavy use of proprietary protocols and potential licensing restrictions on modifications. Bazel build system has steep learning curve and non-trivial configuration.
Active areas of work
Active maintenance with recent focus on Bazel build system modernization (evident from .bazelrc, MODULE.bazel setup), Swift modernization (85M lines of Swift), and app extension improvements. GitHub Actions CI pipeline is configured for automated builds. Code is being actively developed with support for latest iOS features.
🚀Get running
git clone --recursive -j8 https://github.com/TelegramMessenger/Telegram-iOS.git python3 build-system/Make/Make.py --cacheDir="$HOME/telegram-bazel-cache" generateProject --configurationPath=build-system/template_minimal_development_configuration.json --xcodeManagedCodesigning
Daily commands:
- Obtain API credentials from core.telegram.org/api/obtaining_api_id. 2. Run openssl rand -hex 8 to generate identifier. 3. Create Xcode project with org.{identifier}. 4. Edit build-system/template_minimal_development_configuration.json with your credentials and team ID. 5. Run the generateProject command above. 6. Open generated Xcode project and build with Xcode or bazel.
🗺️Map of the codebase
- build-system/Make/Make.py: Python orchestration layer that generates Bazel build configuration and manages the entire build pipeline from JSON config files
- build-system/template_minimal_development_configuration.json: Template configuration file where you inject API credentials, team ID, bundle identifiers, and provisioning profile data for local development
- Telegram/BUILD: Bazel build definition for the main Telegram app target; defines dependencies, resources, and entitlements
- Telegram/NotificationService/Sources/NotificationService.swift: Extension handling encrypted push notifications; critical for offline message delivery and user notification experience
- Telegram/Share/ShareRootController.swift: Share extension UI for sharing content to Telegram from other apps; uses app groups for IPC with main app
- Telegram/SiriIntents/IntentHandler.swift: Siri voice command integration handler; enables 'send message' and contact lookup voice intents
- MODULE.bazel: Bazel module dependency declaration (Bazel 7+ format); defines external dependency graph and Bzlmod setup
- .github/workflows/build.yml: GitHub Actions CI pipeline definition; shows automated build, test, and validation workflow for PRs and releases
🛠️How to make changes
For UI changes: modify Swift files in Telegram/ directory (organized by feature). For notification handling: edit Telegram/NotificationService/Sources/NotificationService.swift. For share extension: modify Telegram/Share/ShareRootController.swift. For Siri: edit Telegram/SiriIntents/IntentHandler.swift, IntentContacts.swift, IntentMessages.swift. For build config: edit build-system/template_minimal_development_configuration.json or appstore-configuration.json. All Swift code changes trigger Bazel rebuild automatically.
🪤Traps & gotchas
- Must obtain real Telegram API credentials (api_id/api_hash) from core.telegram.org — dummy values won't work with backend. 2. Team ID extraction from Keychain Access is macOS-specific; Windows/Linux contributors cannot build locally. 3. Bazel cache directory (--cacheDir) can grow to >20GB; plan disk space accordingly. 4. Build-system/Make.py generates Xcode project dynamically; changes to build config require regeneration before Xcode reflects them. 5. App extensions require separate provisioning profiles and bundle IDs; configuration.json must list all entitlements correctly. 6. Some code may depend on Telegram backend version compatibility; using very old checkout may fail API calls.
💡Concepts to learn
- MTProto (Mobile Transport Protocol) — Telegram's proprietary encrypted protocol for client-server communication; understanding it is essential to grasp how this app authenticates, encrypts messages, and handles API calls
- App Groups & Extension IPC — This codebase heavily uses app groups (shared keychain, shared defaults) for communication between NotificationService, ShareExtension, and main app; critical for understanding data flow across extensions
- Notification Service Extension — Handles encrypted push notifications without displaying plaintext; requires decryption in extension context with restricted capabilities — key security architecture in this codebase
- VoIP Push Notifications (CallKit) — Telegram supports VoIP calling with native CallKit integration; voice/video calls must be initiated via CallKit framework using PushKit for reliability
- Bazel Build System — Entire project uses Bazel for reproducible, incremental builds with Python-based orchestration; must understand bazel run, bazel build, and BUILD file syntax to modify this codebase
- End-to-End Encryption (Secret Chats) — Telegram supports optional secret chats with E2EE using elliptic curve cryptography; implementation visible in C code for performance; understanding crypto assumptions is critical for security audits
- Offline-First Architecture — App must handle network outages gracefully, caching messages locally and syncing when reconnected; this shapes database design and state management throughout the codebase
🔗Related repos
TelegramMessenger/Telegram-Android— Official Telegram Android client; parallel implementation in Java/Kotlin solving same MTProto protocol and feature parityTelegramMessenger/TDLib— Telegram Database Library — cross-platform C++ library used by desktop/web clients and some iOS bindings; shared cryptography and protocol logicsignalapp/Signal-iOS— Alternative encrypted messaging client with similar architecture (app extensions, secure storage, VoIP); reference for iOS messaging best practiceswireapp/wire-ios— Another encrypted messaging app with similar tech stack (Swift, VoIP, share extension); learning resource for iOS messenger patternsrealm/realm-swift— Database library commonly used in iOS apps for local message storage; likely dependency of Telegram-iOS for offline message caching
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive unit tests for SiriIntents handlers
The Telegram/SiriIntents directory contains IntentHandler.swift, IntentContacts.swift, and IntentMessages.swift with no corresponding test files. Given that Siri Intents are critical user-facing features for voice commands and app shortcuts, adding unit tests would ensure reliability across iOS versions and improve maintainability when intent definitions change.
- [ ] Create Telegram/SiriIntents/Tests directory structure
- [ ] Add unit tests for IntentHandler.swift covering contact resolution and message intent handling
- [ ] Add unit tests for IntentContacts.swift testing contact lookup and filtering logic
- [ ] Add unit tests for IntentMessages.swift testing message sending and recipient validation
- [ ] Update Telegram/SiriIntents/BUILD to include test targets
- [ ] Document test coverage expectations in CLAUDE.md
Add integration tests for app extensions (Share, NotificationService, BroadcastUpload)
The repo contains three critical app extensions (Telegram/Share, Telegram/NotificationService, Telegram/BroadcastUpload) but lacks integration tests verifying they correctly handle data exchange with the main app container. These extensions are commonly problematic during iOS updates and require validation of container permissions, group identifiers, and inter-process communication.
- [ ] Create integration test targets in Telegram/Share/BUILD, Telegram/NotificationService/BUILD, and Telegram/BroadcastUpload/BUILD
- [ ] Add tests verifying shared container access and UserDefaults communication
- [ ] Add tests for NotificationService.swift handling notification payloads correctly
- [ ] Add tests for Share extension data persistence and app group synchronization
- [ ] Implement tests validating BroadcastUploadExtension.swift upload completion handling
- [ ] Reference extension tests in .github/workflows/build.yml CI pipeline
Create automated localization validation and syntax check for Intent definitions
The Telegram/SiriIntents directory contains 14+ .intentdefinition files across different language localizations (ar, be, ca, de, es, fa, fr, id, it, ko, ms, nl, pl, pt, etc.), with an UpdateLocalizations.sh script but no automated validation. Missing or malformed intent definitions can cause Siri Intent crashes and are difficult to catch in code review.
- [ ] Create Telegram/SiriIntents/validate_intents.sh script to parse and validate all .intentdefinition XML files
- [ ] Add checks for required intent properties (title, description, category) in all language variants
- [ ] Add checks ensuring all en.lproj intent definitions have corresponding translations
- [ ] Implement plist syntax validation for all .intentdefinition files
- [ ] Create .github/workflows/intent-validation.yml GitHub Action to run validation on PRs modifying Telegram/SiriIntents/**
- [ ] Document validation process in CONTRIBUTING.md for contributors modifying Siri Intents
🌿Good first issues
- Add unit tests for NotificationService.swift message decryption logic — currently no test coverage visible for the critical encrypted push handling
- Document the app groups communication protocol between main app and ShareExtension in README or new ARCHITECTURE.md — would help new contributors understand IPC mechanism
- Add Swift Package Manager support alongside Bazel (create Package.swift root) — reduces friction for developers unfamiliar with Bazel builds
📝Recent commits
Click to expand
Recent commits
ffd8264— Various fixes (laktyushin)9b8abdb— Fix (laktyushin)0664197— Poll improvements (laktyushin)9c3cab2— Fix time-limited poll closing (laktyushin)29ecff3— Various fixes (laktyushin)f34fdef— Bump version (isaac)f92aabe— Merge commit 'fd75bdb3561380f4eed5d91bdf067f2b99942140' (isaac)1c27b2c— Animation and cleanup (isaac)dda6054— Spec: ListView.isStrictlyScrolledToPinToEdgeItem (isaac)fd75bdb— Fix (laktyushin)
🔒Security observations
The Telegram-iOS codebase demonstrates a mature project with some security considerations in place (references to security guidelines, multiple security-conscious file structures). However, critical gaps exist around credential management guidance, insufficient security documentation, and limited visibility into build system configurations. The presence of multiple app extensions increases the attack surface. No evidence of hardcoded secrets was found in the visible file structure, but the absence of documented secure credential handling practices is concerning. The project would benefit from formal security documentation, enhanced credential management, and comprehensive dependency scanning in CI/CD pipelines.
- Medium · API Credentials Exposure Risk —
README.md, Telegram-iOS configuration files. The README explicitly instructs developers to obtain their own api_id but does not provide guidance on secure storage. The codebase structure suggests API credentials may be hardcoded or stored insecurely in configuration files. Fix: Implement a secure credential management system using environment variables, Keychain (on iOS), or a secure secrets management tool. Never commit api_id or api_hash to version control. Use code signing and entitlements to restrict access to sensitive data. - Medium · Insufficient Security Documentation —
README.md, project root configuration. While the README references security guidelines, there is no evidence of security-related configuration validation, security headers, or certificate pinning mechanisms in the visible file structure. Fix: Add comprehensive security documentation covering: certificate pinning implementation, secure network communication patterns, data encryption at rest and in transit, and secure credential handling. Create a SECURITY.md file with vulnerability disclosure policy. - Low · Incomplete Build Configuration Visibility —
BUILD.bazel, MODULE.bazel, .bazelrc. The presence of .bazelrc, MODULE.bazel, and BUILD files suggests a complex build system. Without visibility into these files, potential supply chain risks (dependency version pinning, build cache poisoning) cannot be fully assessed. Fix: Ensure all dependencies are pinned to specific versions with checksums. Implement dependency scanning tools in the CI/CD pipeline (as referenced in .github/workflows/build.yml). Use tools like OWASP Dependency-Check or Snyk. - Low · Git Submodules Without Version Control —
.gitmodules. The presence of .gitmodules indicates submodule dependencies, which can be a supply chain risk if submodule repositories are compromised or become outdated. Fix: Implement submodule verification with cryptographic signatures. Regularly audit submodule sources and maintain a list of approved dependencies. Consider using dependency lock files to ensure reproducible builds. - Low · Extension App Targets May Have Elevated Permissions —
Telegram/NotificationService/, Telegram/Share/, Telegram/SiriIntents/, Telegram/BroadcastUpload/. App extensions (NotificationService, Share, SiriIntents, BroadcastUpload) run with different entitlements than the main app. Improper configuration could lead to privilege escalation or data access beyond intended scope. Fix: Review and minimize entitlements for each extension target. Implement data compartmentalization using App Groups and Keychain sharing only where necessary. Follow principle of least privilege for extension capabilities.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.