Skip to content

[UIScene] Migrate Deep Linking / Universal Links for scenes #174403

@vashworth

Description

@vashworth

Problem

Deep linking on iOS relies on two application lifecycle events. After migrating to UIScene, these events are no longer called by UIKit. Instead, the UIScene lifecycle event is called.

In the engine, when these events are called, it forwards them to the FlutterViewController, which then uses a method channel from the FlutterEngine to send the information to the framework. It will then return with either a success or failure. (Source, Source)

https://docs.flutter.dev/cookbook/navigation/set-up-universal-links#test-the-universal-link

Prerequisites

Proposal

Flutter will need to add the UIScene lifecycle equivalents outlined above. Then when the FlutterSceneDelegate receives the event, instead of forwarding to the FlutterViewController, it will forward it directly to each FlutterEngine associated with it.

- (void)scene:(UIScene*)scene continueUserActivity:(NSUserActivity*)userActivity {
 if (![self isFlutterDeepLinkingEnabled]) {
   return NO;
 }
 for (FlutterEngine* engine in [_engines allObjects]) {
   if (!engine) {
     continue;
   }
   [engine sendDeepLinkToFramework:url ...];
 }
}

See prototype.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions