// // AppDelegate.m // Asteria // // Created by iOS on 2023/4/22. // #import "AppDelegate.h" #import "AS_TabBarViewController.h" #import #import #import #import "AppDelegate+PushNotification.h" #import @import Stripe; @interface AppDelegate () //@property (nonatomic, strong, readonly) UIWindow *window; @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. if (@available(iOS 15.0, *)) { UITableView.appearance.sectionHeaderTopPadding = 0; } else { // Fallback on earlier versions } [ASCurrencyManager.shared getAllCurrencyData]; [ASNetTools reqNet_getAdvCoupons]; // [self xxx_ytkNetConfig]; [PPNetworkHelper openLog]; self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; AS_TabBarViewController *tab = [[AS_TabBarViewController alloc] init]; tab.selectedIndex = 0; self.window.rootViewController = tab; [self.window makeKeyAndVisible]; //StripeAPI [StripeAPI setDefaultPublishableKey:StripePublishableKey]; // 为了使用 Facebook SDK 应该调用如下方法 [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; // 注册 FacebookAppID [[FBSDKSettings sharedSettings] setAppID:Facebook_AppID]; [FIRApp configure]; //推送相关配置 if (ASUserInfoManager.shared.isLogin ) { [ASUserInfoManager.shared getInfo:^{ [self initPushNotificationConfig:launchOptions]; }]; } else { [self initPushNotificationConfig:launchOptions]; } return YES; } -(void)xxx_ytkNetConfig{ YTKNetworkAgent *agent = [YTKNetworkAgent sharedAgent]; [agent setValue:[NSSet setWithObjects:@"application/json", @"text/html", @"text/json", @"text/plain", @"text/javascript", @"text/xml", @"image/*",@"image/jpeg",@"image/jpg",@"image/png",@"application/x-javascript",nil] forKeyPath:@"_manager.responseSerializer.acceptableContentTypes"]; YTKNetworkConfig *config = [YTKNetworkConfig sharedConfig]; config.securityPolicy.allowInvalidCertificates = YES; config.securityPolicy.validatesDomainName = NO; config.baseUrl = [NSString stringWithFormat:@"%@",AS_Server]; NSLog(@"baseUrl-----%@",config.baseUrl) } #pragma mark - **************** applicationDelegate **************** - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url options:options]; // nzk Google Signin BOOL stripeHandled = [StripeAPI handleStripeURLCallbackWithURL:url]; if(stripeHandled){ return YES; } // nzk Google Signin end return YES; } @end