处理通用链接宏控制

This commit is contained in:
2025-10-30 20:53:44 +08:00
parent 6993bfd682
commit 10dfe9b1d6
4 changed files with 15 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
//
// KBFullAccessGuideView.m
// CustomKeyboard
//
// 访
#import "KBFullAccessGuideView.h"
#import "Masonry.h"
@@ -164,7 +164,7 @@
if (!ivc) { [self dismiss]; return; }
// Universal Link scheme
NSURL *ul = [NSURL URLWithString:@"https://your.domain/ul/settings?src=kb_extension"];
NSURL *ul = [NSURL URLWithString:[NSString stringWithFormat:@"%@?src=kb_extension", KB_UL_SETTINGS]];
void (^fallback)(void) = ^{
NSURL *scheme = [NSURL URLWithString:@"kbkeyboard://settings?src=kb_extension"]; // App openURL
[ivc.extensionContext openURL:scheme completionHandler:^(__unused BOOL ok2) {

View File

@@ -14,8 +14,6 @@
#import "KBFullAccessGuideView.h"
static NSString * const kKBFunctionTagCellId = @"KBFunctionTagCellId";
// + App Associated Domains AASA
static NSString * const kKBUniversalLinkLogin = @"https://your.domain/ul/login";
@interface KBFunctionView () <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, KBFunctionBarViewDelegate>
// UI
@@ -172,7 +170,7 @@ static NSString * const kKBUniversalLinkLogin = @"https://your.domain/ul/login";
NSString *title = (indexPath.item < self.itemsInternal.count) ? self.itemsInternal[indexPath.item] : @"";
NSString *encodedTitle = [title stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]] ?: @"";
NSURL *ul = [NSURL URLWithString:[NSString stringWithFormat:@"%@?src=functionView&index=%ld&title=%@", kKBUniversalLinkLogin, (long)indexPath.item, encodedTitle]];
NSURL *ul = [NSURL URLWithString:[NSString stringWithFormat:@"%@?src=functionView&index=%ld&title=%@", KB_UL_LOGIN, (long)indexPath.item, encodedTitle]];
if (!ul) return;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{