1
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#import "KBSkinManager.h"
|
||||
#import "KBAppUpdateView.h"
|
||||
#import "KBInputProfileManager.h"
|
||||
#import "KBWebViewViewController.h"
|
||||
|
||||
static NSTimeInterval const kKBSubscriptionPrefillTTL = 10 * 60.0;
|
||||
|
||||
@@ -355,6 +356,21 @@ static NSTimeInterval const kKBSubscriptionPrefillTTL = 10 * 60.0;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
if ([path hasPrefix:@"/ul/legal"]) {
|
||||
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(),
|
||||
(__bridge CFStringRef)KBDarwinULHandled,
|
||||
NULL, NULL, true);
|
||||
NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
|
||||
NSString *typeValue = nil;
|
||||
for (NSURLQueryItem *item in components.queryItems ?: @[]) {
|
||||
if ([item.name isEqualToString:@"type"]) {
|
||||
typeValue = item.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
[self kb_presentLegalDocumentWithTypeValue:typeValue];
|
||||
return YES;
|
||||
}
|
||||
if ([path hasPrefix:@"/ul/login"]) {
|
||||
// 区分普通登录与“充值”场景:通过 query 中的 entry=recharge 来判断
|
||||
NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
|
||||
@@ -457,6 +473,10 @@ static NSTimeInterval const kKBSubscriptionPrefillTTL = 10 * 60.0;
|
||||
}
|
||||
[KB_CURRENT_NAV pushViewController:vc animated:true];
|
||||
return YES;
|
||||
} else if ([host isEqualToString:@"legal"]) { // kbkeyboard://legal?type=privacy
|
||||
NSDictionary<NSString *, NSString *> *params = [self kb_queryParametersFromURL:url];
|
||||
[self kb_presentLegalDocumentWithTypeValue:params[@"type"]];
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
@@ -537,7 +557,14 @@ static NSTimeInterval const kKBSubscriptionPrefillTTL = 10 * 60.0;
|
||||
// [pop pop];
|
||||
// });
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)kb_presentLegalDocumentWithTypeValue:(NSString *)typeValue {
|
||||
NSNumber *typeNumber = [KBWebViewViewController legalDocumentTypeNumberFromQueryValue:typeValue ?: @""];
|
||||
KBLegalDocumentType type = typeNumber ? typeNumber.integerValue : KBLegalDocumentTypeTermsOfService;
|
||||
KBWebViewViewController *vc = [KBWebViewViewController legalViewControllerWithType:type];
|
||||
[KB_CURRENT_NAV pushViewController:vc animated:true];
|
||||
}
|
||||
|
||||
- (void)kb_openAppSettings {
|
||||
|
||||
Reference in New Issue
Block a user