Skip to content

feat(ios): adopt UISceneDelegate (Flutter 3.38+)#490

Merged
DennisAlund merged 3 commits into
mainfrom
feat/uiscene-delegate-adoption
Jun 9, 2026
Merged

feat(ios): adopt UISceneDelegate (Flutter 3.38+)#490
DennisAlund merged 3 commits into
mainfrom
feat/uiscene-delegate-adoption

Conversation

@DennisAlund

Copy link
Copy Markdown
Member

Summary

Adopts FlutterSceneLifeCycleDelegate on iOS so Facebook URL callbacks (deep links / deferred app links) keep reaching the SDK on apps using the UIScene lifecycle — the default for Flutter 3.38+. Under UIScene, iOS routes URL opens to the scene delegate, so the existing application(_:open:options:) path silently stops firing; this registers as a scene delegate too and forwards those opens. The legacy AppDelegate path is retained for non-UIScene apps.

Mirrors what flutter_facebook_auth 7.1.7 did (same change, same flutter: ">=3.38.0" floor).

Fixes #489.

Changes

  • iOS (FacebookAppEventsPlugin.swift): conform to FlutterSceneLifeCycleDelegate, add registrar.addSceneDelegate(instance), and implement scene(_:openURLContexts:) -> Bool. The handler reconstructs the open-URL options (sourceApplication / annotation / openInPlace) from each UIOpenURLContext and forwards via FBSDK 18.x's modern application(_:open:options:) overload — returning whether the SDK handled any URL.
  • Breaking: minimum Flutter raised to >=3.38.0 (required for FlutterSceneLifeCycleDelegate / addSceneDelegate). Dart sdk constraint unchanged.
  • Version 0.28.00.29.0 (pubspec.yaml + podspec synced per CONTRIBUTING), example Flutter floor raised, lockfiles updated, CHANGELOG.md + README.md updated.
  • No Dart or Android changes — the Dart API and MethodChannel surface are unchanged.

Test plan

  • flutter test — 51/51 pass (no Dart changes; suite confirms no regressions)
  • flutter analyze — no new issues (2 pre-existing infos in example/lib/main.dart)
  • flutter pub get resolves on the new >=3.38.0 floor (root + example)
  • CI: example iOS build via CocoaPods (compiles the new Swift against Flutter 3.38 — could not run locally; this machine has no full Xcode)
  • Optional manual: trigger an fb<APP_ID>:// URL open on a UIScene host app and confirm the SDK processes it

🤖 Generated with Claude Code

DennisAlund and others added 3 commits June 9, 2026 14:17
Pre-existing working-tree edit, committed separately to keep the
UIScene feature commits focused.
Register as a scene delegate and forward scene URL opens to the Facebook
SDK via scene(_:openURLContexts:), keeping the legacy
application(_:open:options:) path for non-UIScene apps. Without this, FB
deep-link / deferred-app-link callbacks stop reaching the SDK on apps
using the UIScene lifecycle (default for Flutter 3.38+).

Mirrors flutter_facebook_auth 7.1.7. Refs #489

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Raise the minimum Flutter SDK to >=3.38.0 (needed for the UIScene scene
delegate APIs), sync the podspec version, raise the example's Flutter
floor to match, and document UIScene support in the README. Refs #489

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 9, 2026 06:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adopts Flutter’s iOS UIScene plugin lifecycle APIs so Facebook SDK URL callbacks (deep links / deferred app links) continue to be forwarded correctly on Flutter 3.38+ apps using UISceneDelegate, while retaining the legacy UIApplicationDelegate path for older setups.

Changes:

  • iOS: register as a FlutterSceneLifeCycleDelegate and forward scene(_:openURLContexts:) URL opens to FBSDKCoreKit’s ApplicationDelegate.
  • Raise minimum Flutter SDK constraint to >=3.38.0 and bump package version to 0.29.0 (including example + lockfiles + podspec sync).
  • Update README/CHANGELOG to document UIScene lifecycle support and the new Flutter floor.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Documents UIScene lifecycle support and updates various documentation links.
pubspec.yaml Bumps package version and raises Flutter minimum to 3.38.0.
pubspec.lock Updates Flutter SDK floor in lockfile metadata.
ios/facebook_app_events/Sources/facebook_app_events/FacebookAppEventsPlugin.swift Registers a scene delegate and forwards scene URL opens to the Facebook SDK.
ios/facebook_app_events.podspec Syncs podspec version to 0.29.0.
example/pubspec.yaml Raises example’s Flutter minimum to 3.38.0.
example/pubspec.lock Syncs example lockfile Flutter floor and local package version.
CHANGELOG.md Adds 0.29.0 entry describing UISceneDelegate adoption and breaking Flutter floor bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment thread README.md
@DennisAlund DennisAlund merged commit ae60514 into main Jun 9, 2026
2 checks passed
@DennisAlund DennisAlund deleted the feat/uiscene-delegate-adoption branch June 9, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UISceneDelegate adoption

2 participants