Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions telegram_login/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.2.1

- Fix iOS compilation error for consumers on older Flutter SDK versions
- Removed `FlutterSceneLifeCycleDelegate` conformance and `addSceneDelegate` call
- These APIs are not available on Flutter versions below 3.16+
- `addApplicationDelegate` alone is sufficient; Flutter's engine forwards scene delegate URL events to registered application delegates automatically
Comment on lines +3 to +6

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 1.2.1 changelog entry claims this release fixes compilation for “older Flutter SDK versions” (and references APIs missing below Flutter 3.16), but the package’s current SDK constraints require Dart ^3.6.0 (pubspec.yaml), which effectively excludes those older Flutter versions. Consider either (a) adjusting the Dart/Flutter constraints to actually support the targeted older Flutter range, or (b) rewording the changelog to clarify the affected consumer scenario (e.g., users building from source / dependency overrides) so it’s not misleading.

Suggested change
- Fix iOS compilation error for consumers on older Flutter SDK versions
- Removed `FlutterSceneLifeCycleDelegate` conformance and `addSceneDelegate` call
- These APIs are not available on Flutter versions below 3.16+
- `addApplicationDelegate` alone is sufficient; Flutter's engine forwards scene delegate URL events to registered application delegates automatically
- Fix iOS compilation issues in source/override-based builds that use Flutter versions below 3.16
- Removed `FlutterSceneLifeCycleDelegate` conformance and `addSceneDelegate` call
- These APIs are not available in Flutter versions below 3.16
- `addApplicationDelegate` alone is sufficient because Flutter's engine forwards scene delegate URL events to registered application delegates automatically
- This change does not alter the package's published Dart/Flutter SDK constraints

Copilot uses AI. Check for mistakes.

## 1.2.0

- iOS implementation is now self-contained and no longer depends on the external `telegram-login-ios` Swift package
Expand Down
2 changes: 1 addition & 1 deletion telegram_login/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Add the package to your app's `pubspec.yaml`:

```yaml
dependencies:
telegram_login: ^1.2.0
telegram_login: ^1.2.1
```

Then run `flutter pub get`.
Expand Down
59 changes: 3 additions & 56 deletions telegram_login/ios/Classes/TelegramLoginPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import UIKit
/// - Receiving and processing callback URLs from Telegram
/// - Delivering login results or errors back to Dart
///
/// The plugin supports both classic `UIApplicationDelegate` apps and modern
/// scene-based apps (iOS 13+). URL callbacks are automatically forwarded to
/// the Telegram SDK for processing.
/// URL callbacks from the app delegate are automatically forwarded to the
/// Telegram SDK for processing.
public class TelegramLoginPlugin: NSObject, FlutterPlugin {

/// Indicates whether the Telegram Login SDK has been configured with
Expand All @@ -27,7 +26,7 @@ public class TelegramLoginPlugin: NSObject, FlutterPlugin {
/// Registers the plugin with the Flutter engine.
///
/// Creates the method channel, initializes the plugin instance, and
/// registers for application/scene delegate callbacks to handle URL opens.
/// registers for application delegate callbacks to handle URL opens.
///
/// - Parameter registrar: The Flutter plugin registrar for registering
/// method channels and application delegates.
Expand All @@ -39,9 +38,6 @@ public class TelegramLoginPlugin: NSObject, FlutterPlugin {
let instance = TelegramLoginPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
registrar.addApplicationDelegate(instance)
if #available(iOS 13.0, *) {
registrar.addSceneDelegate(instance)
}
}
Comment on lines 38 to 41

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR metadata/title suggests this is primarily a version bump, but the diff also changes iOS runtime/registration behavior by removing addSceneDelegate / FlutterSceneLifeCycleDelegate handling. Please update the PR description and select the appropriate “Type of Change” checkbox(es) so reviewers/consumers can understand the behavioral impact of the release.

Copilot uses AI. Check for mistakes.

/// Handles incoming method calls from the Dart side.
Expand Down Expand Up @@ -326,52 +322,3 @@ public class TelegramLoginPlugin: NSObject, FlutterPlugin {
return true
}
}

// MARK: - FlutterSceneLifeCycleDelegate (scene-based apps, iOS 13+)
//
// These methods are called by Flutter for apps using the UIScene lifecycle
// (iOS 13+). They handle URL callbacks in modern scene-based apps.

@available(iOS 13.0, *)
extension TelegramLoginPlugin: FlutterSceneLifeCycleDelegate {

/// Handles URL open requests in a scene-based app.
///
/// Called when the app receives a URL through a custom scheme
/// (e.g., `tglogin://callback`). Extracts the first URL from the
/// context set and forwards it to the Telegram SDK.
///
/// - Parameters:
/// - scene: The UIScene that received the URL
/// - URLContexts: A set of UIOpenURLContext objects containing URLs
/// - Returns: `true` if a URL was handled, `false` otherwise
public func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) -> Bool {
guard let url = URLContexts.first?.url else { return false }
DispatchQueue.main.async { [weak self] in
self?.forwardUrl(url)
}
return true
}

/// Handles universal link continuations in a scene-based app.
///
/// Called when the app is opened via a universal link during a scene
/// transition. Checks if the activity is a web browsing activity and
/// forwards the URL to the Telegram SDK for OAuth callback processing.
///
/// - Parameters:
/// - scene: The UIScene that received the activity
/// - userActivity: The NSUserActivity containing the web URL
/// - Returns: `true` if the URL was handled (was a web browsing URL),
/// `false` otherwise
public func scene(_ scene: UIScene, continue userActivity: NSUserActivity) -> Bool {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL else {
return false
}
DispatchQueue.main.async { [weak self] in
self?.forwardUrl(url)
}
return true
}
}
2 changes: 1 addition & 1 deletion telegram_login/ios/telegram_login.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'telegram_login'
s.version = '1.2.0'
s.version = '1.2.1'
s.summary = 'Telegram Login SDK for Flutter (iOS)'
s.description = <<-DESC
A Flutter plugin that provides Telegram Login functionality on iOS using ASWebAuthenticationSession and CryptoKit.
Expand Down
2 changes: 1 addition & 1 deletion telegram_login/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: telegram_login
description: "Flutter plugin for Telegram Login, enabling passwordless OAuth authentication with native SDK integration for iOS and Android."
version: 1.2.0
version: 1.2.1
homepage: https://github.com/khode-io/telegram-login-flutter

environment:
Expand Down