mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make iOS embedding to send full uri for deeplinks (flutter/engine#41992)
related https://github.com/flutter/flutter/issues/100624 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
parent
0c46b09bbf
commit
d21dc12d2f
@ -150,17 +150,10 @@ static NSString* const kRestorationStateAppModificationKey = @"mod-date";
|
||||
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,
|
||||
}];
|
||||
}
|
||||
}];
|
||||
|
||||
@ -67,8 +67,9 @@ FLUTTER_ASSERT_ARC
|
||||
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 @@ FLUTTER_ASSERT_ARC
|
||||
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 @@ FLUTTER_ASSERT_ARC
|
||||
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 @@ FLUTTER_ASSERT_ARC
|
||||
restorationHandler:^(NSArray<id<UIUserActivityRestoring>>* __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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user