diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index abc1bd8e6b7e6..741a0bf626cbf 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -150,17 +150,10 @@ - (BOOL)openURL:(NSURL*)url { FML_LOG(ERROR) << "Timeout waiting for the first frame when launching an URL."; } else { - NSString* fullRoute = url.path; - if ([url.query length] != 0) { - fullRoute = [NSString stringWithFormat:@"%@?%@", fullRoute, url.query]; - } - if ([url.fragment length] != 0) { - fullRoute = [NSString stringWithFormat:@"%@#%@", fullRoute, url.fragment]; - } [flutterViewController.engine.navigationChannel invokeMethod:@"pushRouteInformation" arguments:@{ - @"location" : fullRoute, + @"location" : url.absoluteString, }]; } }]; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm index 035b726188d1d..81b93f0a8ff13 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegateTest.mm @@ -67,8 +67,9 @@ - (void)testLaunchUrl { openURL:[NSURL URLWithString:@"http://myApp/custom/route?query=test"] options:@{}]; XCTAssertTrue(result); - OCMVerify([self.mockNavigationChannel invokeMethod:@"pushRouteInformation" - arguments:@{@"location" : @"/custom/route?query=test"}]); + OCMVerify([self.mockNavigationChannel + invokeMethod:@"pushRouteInformation" + arguments:@{@"location" : @"http://myApp/custom/route?query=test"}]); } - (void)testLaunchUrlWithDeepLinkingNotSet { @@ -106,7 +107,7 @@ - (void)testLaunchUrlWithQueryParameterAndFragment { XCTAssertTrue(result); OCMVerify([self.mockNavigationChannel invokeMethod:@"pushRouteInformation" - arguments:@{@"location" : @"/custom/route?query=test#fragment"}]); + arguments:@{@"location" : @"http://myApp/custom/route?query=test#fragment"}]); } - (void)testLaunchUrlWithFragmentNoQueryParameter { @@ -118,8 +119,9 @@ - (void)testLaunchUrlWithFragmentNoQueryParameter { openURL:[NSURL URLWithString:@"http://myApp/custom/route#fragment"] options:@{}]; XCTAssertTrue(result); - OCMVerify([self.mockNavigationChannel invokeMethod:@"pushRouteInformation" - arguments:@{@"location" : @"/custom/route#fragment"}]); + OCMVerify([self.mockNavigationChannel + invokeMethod:@"pushRouteInformation" + arguments:@{@"location" : @"http://myApp/custom/route#fragment"}]); } - (void)testReleasesWindowOnDealloc { @@ -152,8 +154,9 @@ - (void)testUniversalLinkPushRouteInformation { restorationHandler:^(NSArray>* __nullable restorableObjects){ }]; XCTAssertTrue(result); - OCMVerify([self.mockNavigationChannel invokeMethod:@"pushRouteInformation" - arguments:@{@"location" : @"/custom/route?query=test"}]); + OCMVerify([self.mockNavigationChannel + invokeMethod:@"pushRouteInformation" + arguments:@{@"location" : @"http://myApp/custom/route?query=test"}]); } @end