处理ios18从其他app用自己键盘 拉起主app的bug
其他问题
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#import "KBFullAccessManager.h"
|
||||
#import "KBSkinManager.h"
|
||||
#import "KBSkinInstallBridge.h"
|
||||
#import "KBExtensionAppLauncher.h"
|
||||
#import "KBHostAppLauncher.h"
|
||||
|
||||
// 提前声明一个类别,使编译器在 static 回调中识别 kb_consumePendingShopSkin 方法。
|
||||
@interface KeyboardViewController (KBSkinShopBridge)
|
||||
@@ -213,21 +213,26 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
[self showFunctionPanel:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
// // 1. 构造充值入口的通用链接(UL)和自定义 Scheme:
|
||||
// // - 当前复用 /login 路径,通过 entry=recharge 区分场景:
|
||||
// // https://app.tknb.net/ul/login?src=keyboard&entry=recharge
|
||||
// // - 若宿主拒绝或 UL 配置异常,则回退到 kbkeyboardAppExtension://recharge?src=keyboard
|
||||
// NSString *ulStr = [NSString stringWithFormat:@"%@?src=keyboard&entry=recharge", KB_UL_RECHARGE];
|
||||
// NSURL *ul = [NSURL URLWithString:ulStr];
|
||||
//
|
||||
NSString *schemeStr = [NSString stringWithFormat:@"%@://recharge?src=keyboard", KB_APP_SCHEME];
|
||||
NSURL *scheme = [NSURL URLWithString:schemeStr];
|
||||
//
|
||||
// if (!ul && !scheme) { return; }
|
||||
//
|
||||
// 从当前视图作为起点,通过响应链找到 UIApplication 再调起主 App
|
||||
BOOL ok = [KBHostAppLauncher openHostAppURL:scheme fromResponder:self.view];
|
||||
|
||||
// 1. 构造自定义 scheme:kbkeyboardAppExtension://recharge?src=keyboard
|
||||
NSString *urlStr = [NSString stringWithFormat:@"%@://recharge?src=keyboard", KB_APP_SCHEME];
|
||||
NSURL *scheme = [NSURL URLWithString:urlStr];
|
||||
if (!scheme) return;
|
||||
|
||||
// 2. 通过统一工具封装:extensionContext + 响应链兜底
|
||||
[KBExtensionAppLauncher openScheme:scheme
|
||||
usingInputController:self
|
||||
source:self.view
|
||||
completion:^(BOOL success) {
|
||||
if (!success) {
|
||||
[KBHUD showInfo:KBLocalized(@"请切换到主App完成充值")];
|
||||
}
|
||||
}];
|
||||
if (!ok) {
|
||||
// 失败兜底:给个文案提示
|
||||
// 比如:请回到桌面手动打开 XXX App 进行设置/充值
|
||||
}
|
||||
}
|
||||
|
||||
- (void)keyBoardMainViewDidTapSettings:(KBKeyBoardMainView *)keyBoardMainView {
|
||||
|
||||
Reference in New Issue
Block a user