Files
keyboard/Shared/KBHostAppLauncher.m
CodeST d8a84dc478 处理上架的问题
1:处理了openurl 拉起问题
2:去掉了http
3 隐私等等
2026-03-05 14:30:07 +08:00

41 lines
977 B
Objective-C

//
// KBHostAppLauncher.m
// keyBoard
//
// Created by Mac on 2025/11/24.
//
// KBHostAppLauncher.m
#import "KBHostAppLauncher.h"
#import <TargetConditionals.h>
#if !TARGET_OS_EXTENSION
#import <UIKit/UIKit.h>
#endif
@implementation KBHostAppLauncher
+ (BOOL)openHostAppURL:(NSURL *)url fromResponder:(UIResponder *)startResponder {
if (!url || !startResponder) return NO;
#if TARGET_OS_EXTENSION
// App Extension 环境下禁止使用 UIApplication。
return NO;
#else
// 在主 App 内直接通过 UIApplication 打开即可,不需要 responder 链绕行。
UIApplication *app = UIApplication.sharedApplication;
if (!app) { return NO; }
if (@available(iOS 10.0, *)) {
[app openURL:url options:@{} completionHandler:nil];
return YES;
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return [app openURL:url];
#pragma clang diagnostic pop
}
#endif
}
@end