处理通用链接宏控制
This commit is contained in:
@@ -20,5 +20,11 @@
|
||||
// 网络基地址(Mock环境)
|
||||
#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/"
|
||||
|
||||
// 通用链接(Universal Links)统一配置
|
||||
// 配置好 AASA 与 Associated Domains 后,只需修改这里即可切换域名/path。
|
||||
#define KB_UL_BASE @"https://your.domain/ul" // 替换为你的真实域名与前缀路径
|
||||
#define KB_UL_LOGIN KB_UL_BASE @"/login"
|
||||
#define KB_UL_SETTINGS KB_UL_BASE @"/settings"
|
||||
|
||||
|
||||
#endif /* PrefixHeader_pch */
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(), ^{
|
||||
|
||||
@@ -32,6 +32,12 @@
|
||||
// 网络基地址(Mock环境)
|
||||
#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/"
|
||||
|
||||
// 通用链接(Universal Links)统一配置
|
||||
// 仅需修改这里的域名/前缀,工程内所有使用 UL 的地方都会同步。
|
||||
#define KB_UL_BASE @"https://your.domain/ul" // 替换为你的真实域名与前缀路径
|
||||
#define KB_UL_LOGIN KB_UL_BASE @"/login"
|
||||
#define KB_UL_SETTINGS KB_UL_BASE @"/settings"
|
||||
|
||||
/// UI 尺寸/设备宏
|
||||
// 屏幕尺寸
|
||||
#define KB_SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
|
||||
|
||||
Reference in New Issue
Block a user