mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
iOS deeplink sends "path + query" instead of just path (flutter/engine#23562)
This commit is contained in:
parent
2c20425be9
commit
52e5aebff7
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user