This commit is contained in:
2025-11-17 16:16:38 +08:00
parent d849b201ca
commit f366a4aa6c
20 changed files with 585 additions and 1 deletions

View File

@@ -21,6 +21,7 @@
#import "KBLoginPopView.h"
#import "IAPVerifyTransactionObj.h"
#import "FGIAPManager.h"
#import "KBSexSelVC.h"
// bundle id target
// PRODUCT_BUNDLE_IDENTIFIER
// CustomKeyboard target com.loveKey.nyx.CustomKeyboard
@@ -32,11 +33,21 @@ static NSString * const kKBKeyboardExtensionBundleId = @"com.loveKey.nyx.CustomK
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 1.
[[FGIAPManager shared] setConfigureWith:[IAPVerifyTransactionObj new]];
[self setupRootVC];
// Skip TabBar
BOOL hasShownSexVC = [[NSUserDefaults standardUserDefaults] boolForKey:KBSexSelectShownKey];
if (hasShownSexVC) {
[self setupRootVC];
} else {
[self setupSexSelectRootVC];
}
// 访
[KBNetworkManager shared].enabled = YES;
///
[self getNetJudge];
///
[self kb_fireStartupNetworkRequest];
#if !DEBUG
/// Bugly
@@ -61,6 +72,24 @@ static NSString * const kKBKeyboardExtensionBundleId = @"com.loveKey.nyx.CustomK
self.window.rootViewController = vc;
}
///
- (void)setupSexSelectRootVC {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
KBSexSelVC *sexVC = [KBSexSelVC new];
__weak typeof(self) weakSelf = self;
sexVC.didFinishSelectBlock = ^{
// TabBar
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:KBSexSelectShownKey];
[[NSUserDefaults standardUserDefaults] synchronize];
// TabBar
[weakSelf setupRootVC];
};
self.window.rootViewController = sexVC;
}
#pragma mark - Permission presentation
@@ -172,6 +201,24 @@ static NSString * const kKBKeyboardExtensionBundleId = @"com.loveKey.nyx.CustomK
// KBGuideVC
}
/// 使
/// 访使
- (void)kb_fireStartupNetworkRequest {
NSURL *url = [NSURL URLWithString:@"https://www.apple.com"];
if (!url) { return; }
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
NSURLSessionDataTask *task = [session dataTaskWithURL:url
completionHandler:^(NSData * _Nullable data,
NSURLResponse * _Nullable response,
NSError * _Nullable error) {
// 线
dispatch_async(dispatch_get_main_queue(), ^{
});
}];
[task resume];
}
-(void)getNetJudge {