Skip to content

iOS Universal Links for Navigator2.0/Router with FlutterDeepLinkingEnabled #82550

@abegehr

Description

@abegehr

Steps to Reproduce

  1. Create a new flutter app.
  2. Setup the iOS config as outlined here: https://flutter.dev/docs/development/ui/navigation/deep-linking. Including setting FlutterDeepLinkingEnabled to true in the Info.plist
  3. Create a simple MaterialApp.router() with a routeInformationParser that simply prints to the console (the app uses the beamer package for the routerDelegate, whereas the point here is that the routeInformationParser does not get called on deep link open) :
class App extends StatelessWidget {
  final routerDelegate = BeamerRouterDelegate(
    locationBuilder: BeamerLocationBuilder(
      beamLocations: [
        WelcomeLocation(),
      ],
    ),
    initialPath: WelcomeLocation.name,
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
        routeInformationParser: SimpleParser(),
        routerDelegate: routerDelegate,
    );
  }
}

class SimpleParser extends RouteInformationParser<Object> {
  @override
  Future<Object> parseRouteInformation(
      RouteInformation routeInformation) async {
    print('Deep Link – routeInformation: $routeInformation');
    return Future.value(Object());
  }
}
  1. Run the app and open a deep link.

Expected results:

SimpleParser.parseRouteInformation() gets called and a console log is printed for each deep link open when the app is running as is specified in the behavior section of the docs: https://flutter.dev/docs/development/ui/navigation/deep-linking#behavior

Actual results:

SimpleParser.parseRouteInformation() gets called once on initial open and then does not got called when opening a deep link.
The deep link is registered somehow, since Analytics does notice the deep link open (see screenshot):
Screenshot 2021-05-14 at 18 43 14

Logs

log.txt

Analyzing smallgroups...                                                
No issues found! (ran in 5.3s)
[✓] Flutter (Channel dev, 2.3.0-1.0.pre, on macOS 11.3.1 20E241 darwin-x64, locale en-DE)
    • Flutter version 2.3.0-1.0.pre at /Users/anton/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d97f41caed (2 weeks ago), 2021-04-30 12:35:21 -0700
    • Engine revision e7939e091e
    • Dart version 2.14.0 (build 2.14.0-48.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/anton/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.22.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.3.1 20E241 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 90.0.4430.212
    ! Error: Anton’s iPhone is not connected. Xcode will continue when Anton’s iPhone is connected. (code -13)

• No issues found!
  • I have just disconnected the iOS device but was testing on it before.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listengineflutter/engine related. See also e: labels.f: routesNavigator, Router, and related APIs.platform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions