Commit 26fe180f authored by 汪林玲's avatar 汪林玲

解决scheme之间冲突

parent d277ef7d
...@@ -51,22 +51,6 @@ static id _instance; ...@@ -51,22 +51,6 @@ static id _instance;
} }
} }
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nonnull))restorationHandler{
NSURL *url = [userActivity webpageURL];
if(url){
[self foundSchemeURL: url];
}
return YES;
}
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity API_AVAILABLE(ios(13.0)){
NSURL *url = [userActivity webpageURL];
if(url){
[self foundSchemeURL: url];
}
}
- (void)foundSchemeURL:(NSURL * _Nullable)url { - (void)foundSchemeURL:(NSURL * _Nullable)url {
NSString *_scheme = @""; NSString *_scheme = @"";
NSString *_host = @""; NSString *_host = @"";
...@@ -113,6 +97,25 @@ static id _instance; ...@@ -113,6 +97,25 @@ static id _instance;
return YES; return YES;
} }
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nonnull))restorationHandler{
if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]){
NSURL *url = [userActivity webpageURL];
if(url){
[self foundSchemeURL: url];
return NO;
}
}
return YES;
}
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity API_AVAILABLE(ios(13.0)){
NSURL *url = [userActivity webpageURL];
if(url){
[self foundSchemeURL: url];
}
}
#pragma mark - handleOpenURL #pragma mark - handleOpenURL
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
[self foundSchemeURL:url]; [self foundSchemeURL:url];
...@@ -134,6 +137,4 @@ static id _instance; ...@@ -134,6 +137,4 @@ static id _instance;
_eventSink = nil; _eventSink = nil;
return nil; return nil;
} }
@end @end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment