Files
telegram-tui/crates/tele-ios-ffi
2026-05-21 00:48:30 +03:00
..
2026-05-21 00:45:39 +03:00
2026-05-20 23:50:53 +03:00

tele-ios-ffi

UniFFI bridge for the future native iOS app.

Current scope:

  • Exposes a fake-backed SessionHandle for Swift integration tests and app shell work.
  • Mirrors the tele-core::session DTO/event model with UniFFI-compatible records and enums.
  • Keeps real TDLib session creation out of this crate until iOS simulator/device linking is validated.

Generate Swift bindings and headers:

scripts/generate-ios-ffi-bindings.sh

The script builds target/release/libtele_ios_ffi.a and writes Swift sources, headers, a Swift typecheck-friendly tele_ios_ffiFFI module map, and an XCFramework-compatible module map under build/ios-ffi/.

Build the fake-only iOS simulator XCFramework without linking TDLib:

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer scripts/build-ios-fake-ffi-xcframework.sh

Run an executable Swift smoke test against matching fake-only UniFFI bindings:

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer scripts/smoke-ios-ffi-swift.sh

Typecheck the Swift app bridge against generated UniFFI bindings:

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer scripts/typecheck-ios-uniffi-app-bridge.sh

Current linking status:

  • Xcode is installed at /Applications/Xcode.app, and DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -version reports Xcode 26.5.
  • The iOS 26.5 simulator runtime is installed and scripts/check-ios-prereqs.sh passes with available iPhone/iPad simulators.
  • The current app shell uses the fake Swift bridge. Real TDLib iOS simulator/device linking is still pending until TDLib is built for iphonesimulator and iphoneos and wired into the UniFFI target.
  • Run scripts/check-ios-tdlib-linking.sh to reproduce the current TDLib iOS blocker documented in docs/ios/tdlib-linking.md.