未验证 提交 7f667148 编写于 作者: S Sarbagya Dhaubanjar 提交者: GitHub

iOS deeplink sends "path + query" instead of just path (#23562)

上级 87960d8b
......@@ -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;
......
......@@ -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<UIApplicationOpenURLOptionsKey, id>* 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册