feat(ios): adopt UISceneDelegate (Flutter 3.38+)#490
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
FlutterSceneLifeCycleDelegateand forwardscene(_:openURLContexts:)URL opens toFBSDKCoreKit’sApplicationDelegate. - Raise minimum Flutter SDK constraint to
>=3.38.0and bump package version to0.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts
FlutterSceneLifeCycleDelegateon 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 existingapplication(_: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_auth7.1.7 did (same change, sameflutter: ">=3.38.0"floor).Fixes #489.
Changes
FacebookAppEventsPlugin.swift): conform toFlutterSceneLifeCycleDelegate, addregistrar.addSceneDelegate(instance), and implementscene(_:openURLContexts:) -> Bool. The handler reconstructs the open-URL options (sourceApplication/annotation/openInPlace) from eachUIOpenURLContextand forwards via FBSDK 18.x's modernapplication(_:open:options:)overload — returning whether the SDK handled any URL.>=3.38.0(required forFlutterSceneLifeCycleDelegate/addSceneDelegate). Dartsdkconstraint unchanged.0.28.0→0.29.0(pubspec.yaml+ podspec synced per CONTRIBUTING), example Flutter floor raised, lockfiles updated,CHANGELOG.md+README.mdupdated.Test plan
flutter test— 51/51 pass (no Dart changes; suite confirms no regressions)flutter analyze— no new issues (2 pre-existing infos inexample/lib/main.dart)flutter pub getresolves on the new>=3.38.0floor (root + example)fb<APP_ID>://URL open on a UIScene host app and confirm the SDK processes it🤖 Generated with Claude Code