Skip to content

chore(iOS): Adds support for UISceneDelegate.#435

Open
thangtv-3206 wants to merge 1 commit intoAppsFlyerSDK:masterfrom
thangtv-3206:master
Open

chore(iOS): Adds support for UISceneDelegate.#435
thangtv-3206 wants to merge 1 commit intoAppsFlyerSDK:masterfrom
thangtv-3206:master

Conversation

@thangtv-3206
Copy link

@thangtv-3206 thangtv-3206 commented Mar 18, 2026

Follow the migration guide for Flutter plugins and AppsFlyer guide to support UISceneDelegate

Copilot AI review requested due to automatic review settings March 18, 2026 10:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 NSUserActivity to AppsFlyerAttribution.

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>
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.

2 participants