处理ios18从其他app用自己键盘 拉起主app的bug
其他问题
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#import "IAPVerifyTransactionObj.h"
|
||||
#import "FGIAPManager.h"
|
||||
#import "KBSexSelVC.h"
|
||||
#import "KBKeyboardPermissionManager.h"
|
||||
|
||||
// 注意:用于判断系统已启用本输入法扩展的 bundle id 需与扩展 target 的
|
||||
// PRODUCT_BUNDLE_IDENTIFIER 完全一致。
|
||||
@@ -37,6 +38,15 @@
|
||||
/// 2:配置国际化
|
||||
[KBLocalizationManager shared].supportedLanguageCodes = @[ @"en", @"zh-Hans"];
|
||||
|
||||
// 首次安装/升级:重置“完全访问”记录,避免继承旧安装遗留在 Keychain 中的状态
|
||||
static NSString *const kKBFullAccessRecordInitializedKey = @"KBFullAccessRecordInitialized";
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
if (![ud boolForKey:kKBFullAccessRecordInitializedKey]) {
|
||||
[[KBKeyboardPermissionManager shared] resetFullAccessRecord];
|
||||
[ud setBool:YES forKey:kKBFullAccessRecordInitializedKey];
|
||||
[ud synchronize];
|
||||
}
|
||||
|
||||
// 首次安装先进入性别选择页;点击 Skip 或确认后再进入主 TabBar
|
||||
BOOL hasShownSexVC = [[NSUserDefaults standardUserDefaults] boolForKey:KBSexSelectShownKey];
|
||||
if (hasShownSexVC) {
|
||||
@@ -110,13 +120,31 @@
|
||||
NSString *host = url.host.lowercaseString ?: @"";
|
||||
if ([host hasSuffix:@"app.tknb.net"]) {
|
||||
NSString *path = url.path.lowercaseString ?: @"";
|
||||
if ([path hasPrefix:@"/ul/settings"]) { [self kb_openAppSettings]; return YES; }
|
||||
if ([path hasPrefix:@"/ul/settings"]) {
|
||||
[self kb_openAppSettings];
|
||||
return YES;
|
||||
}
|
||||
if ([path hasPrefix:@"/ul/login"]) {
|
||||
// 区分普通登录与“充值”场景:通过 query 中的 entry=recharge 来判断
|
||||
NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
|
||||
NSString *entry = nil;
|
||||
for (NSURLQueryItem *item in components.queryItems ?: @[]) {
|
||||
if ([item.name isEqualToString:@"entry"]) {
|
||||
entry = item.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 通知扩展:UL 已被主 App 接收,扩展可取消回退到 Scheme
|
||||
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(),
|
||||
(__bridge CFStringRef)KBDarwinULHandled,
|
||||
NULL, NULL, true);
|
||||
[self kb_presentLoginSheetIfNeeded];
|
||||
if ([entry isEqualToString:@"recharge"]) {
|
||||
// 充值入口:拉起主 App 后进入充值相关页面(目前先做占位提示)
|
||||
[KBHUD showInfo:@"去充值"];
|
||||
} else {
|
||||
// 默认逻辑:登录
|
||||
[self kb_presentLoginSheetIfNeeded];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user