dartway_telegram 0.3.0
dartway_telegram: ^0.3.0 copied to clipboard
Telegram Mini App integration for DartWay apps: initialize the Telegram WebApp, read its safe-area insets and the Telegram user id. Optional by design.
Changelog #
0.3.0 #
- This package now targets the rewritten DartWay framework:
dartway_flutteris nowdartway_core_flutter^0.20.0, and the two-word renames that came with it (DwFlutter→DwFlutterToolbox,DwConfig→DwFlutterConfig,DwPlugin→DwFlutterPlugin,DwPlugins→DwPluginRegistry).DwTelegramWebAppnowextends DwFlutterPlugin(itimplements DwPluginbefore) — otherwise the previously published0.2.0(ondartway_flutter^0.5.0) is identical.
0.2.0 #
Follows dartway_flutter 0.5.0, where DwPlugin.init() gained the core as an argument:
DwTelegramWebApp.init(DwFlutter core). The bridge asks Telegram for everything it knows and needs
nothing from the core — the parameter is the plugin contract, and behaviour is unchanged. Breaking
only for a consumer that implements DwTelegramWebApp itself.
0.1.1 #
Moves to dartway_flutter 0.2.0 (breaking DwFeatureSpec), so the two resolve together.
0.1.0 #
First public release — Telegram Mini App integration for DartWay apps.
DwTelegramWebApp initializes the Telegram WebApp and exposes what an app actually needs from it:
isRunningInTelegram, platform, safeAreaInset (the Telegram chrome, not the phone's) and
telegramUserId. Configured with DwTelegramWebAppConfig.
A plugin, not a framework feature. The framework's config has no business knowing a vendor's
name, and an app that is not a Mini App should not download a Telegram SDK to get a bootstrap
runner. You declare DwFlutter(config: ..., plugins: [DwTelegramWebApp.create(...)]) and reach the bridge as
dw.plugins.telegram — an extension declared in this package, so the ambient accessor exists only for the
apps that chose Telegram.
The same build works in a plain browser. Outside Telegram the JS bridge is simply absent, which
is where naive integrations throw. Here every access is guarded and answers as if Telegram were not
there; isRunningInTelegram says which world the app is in. An unrecognized Telegram client maps to
DwTelegramPlatform.other rather than silently becoming something else.