封装跨应用拉起,
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#import "KBFullAccessManager.h"
|
||||
#import "KBSkinManager.h"
|
||||
#import "KBSkinInstallBridge.h"
|
||||
#import "KBExtensionAppLauncher.h"
|
||||
|
||||
// 提前声明一个类别,使编译器在 static 回调中识别 kb_consumePendingShopSkin 方法。
|
||||
@interface KeyboardViewController (KBSkinShopBridge)
|
||||
@@ -206,13 +207,25 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
}
|
||||
|
||||
- (void)keyBoardMainView:(KBKeyBoardMainView *)keyBoardMainView didTapToolActionAtIndex:(NSInteger)index {
|
||||
if (index == 0) {
|
||||
/// 充值操作
|
||||
[KBHUD showInfo:KBLocalized(@"Recharge Now")];
|
||||
// [self showFunctionPanel:YES];
|
||||
} else {
|
||||
if (index != 0) {
|
||||
[self showFunctionPanel:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
// 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完成充值")];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)keyBoardMainViewDidTapSettings:(KBKeyBoardMainView *)keyBoardMainView {
|
||||
|
||||
Reference in New Issue
Block a user