diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index 72fa8344f64..472a6e8b1fd 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -159,8 +159,13 @@ static BOOL IsDeepLinkingEnabled(NSDictionary* infoDictionary) { FML_LOG(ERROR) << "Timeout waiting for the first frame when launching an URL."; } else { + NSString* pathAndQuery = url.path; + if ([url.query length] != 0) { + pathAndQuery = + [NSString stringWithFormat:@"%@?%@", pathAndQuery, url.query]; + } [flutterViewController.engine.navigationChannel invokeMethod:@"pushRoute" - arguments:url.path]; + arguments:pathAndQuery]; } }]; return YES; diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm index abbfafc919c..6a62697dbfe 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm @@ -30,7 +30,7 @@ FLUTTER_ASSERT_ARC appDelegate.rootFlutterViewControllerGetter = ^{ return viewController; }; - NSURL* url = [NSURL URLWithString:@"http://example.com"]; + NSURL* url = [NSURL URLWithString:@"http://myApp/custom/route?query=test"]; NSDictionary* options = @{}; BOOL result = [appDelegate application:[UIApplication sharedApplication] openURL:url @@ -39,7 +39,7 @@ FLUTTER_ASSERT_ARC return @{@"FlutterDeepLinkingEnabled" : @(YES)}; }]; XCTAssertTrue(result); - OCMVerify([navigationChannel invokeMethod:@"pushRoute" arguments:url.path]); + OCMVerify([navigationChannel invokeMethod:@"pushRoute" arguments:@"/custom/route?query=test"]); } @end