chore(iOS): Adds support for UISceneDelegate.#435
Open
thangtv-3206 wants to merge 1 commit intoAppsFlyerSDK:masterfrom
Open
chore(iOS): Adds support for UISceneDelegate.#435thangtv-3206 wants to merge 1 commit intoAppsFlyerSDK:masterfrom
thangtv-3206 wants to merge 1 commit intoAppsFlyerSDK:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds iOS Scene lifecycle support to the Flutter AppsFlyer plugin so universal links / NSUserActivity deep links can be captured when apps use UIScene (iOS 13+), not only UIApplicationDelegate.
Changes:
- Registers the plugin as a Scene delegate via the Flutter registrar.
- Updates the plugin interface to conform to
FlutterSceneLifeCycleDelegate. - Implements Scene lifecycle callbacks to forward
NSUserActivitytoAppsFlyerAttribution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ios/Classes/AppsflyerSdkPlugin.m | Registers a scene delegate and adds UIScene lifecycle handlers for deep linking. |
| ios/Classes/AppsflyerSdkPlugin.h | Adds FlutterSceneLifeCycleDelegate conformance to the plugin interface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [registrar addMethodCallDelegate:instance channel:callbackChannel]; | ||
| [registrar addApplicationDelegate:instance]; | ||
|
|
||
| [registrar addSceneDelegate:instance]; |
Comment on lines
+955
to
+971
| - (BOOL)scene:(UIScene*)scene | ||
| willConnectToSession:(UISceneSession*)session | ||
| options:(nullable UISceneConnectionOptions*)connectionOptions { | ||
| if ([scene isKindOfClass:[UIWindowScene class]]) { | ||
| NSUserActivity *userActivity = connectionOptions.userActivities.allObjects.firstObject; | ||
| if (userActivity) { | ||
| [self scene:scene continueUserActivity:userActivity]; | ||
| } | ||
| } | ||
|
|
||
| return NO; | ||
| } | ||
|
|
||
| - (BOOL)scene:(UIScene*)scene continueUserActivity:(NSUserActivity*)userActivity { | ||
| [[AppsFlyerAttribution shared] continueUserActivity:userActivity restorationHandler:nil]; | ||
|
|
||
| return NO; |
| #endif | ||
|
|
||
| @interface AppsflyerSdkPlugin: NSObject<FlutterPlugin> | ||
| @interface AppsflyerSdkPlugin: NSObject<FlutterPlugin, FlutterSceneLifeCycleDelegate> |
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.
Follow the migration guide for Flutter plugins and AppsFlyer guide to support UISceneDelegate