123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- //
- // AppDelegate.m
- // Asteria
- //
- // Created by iOS on 2023/4/22.
- //
- #import "AppDelegate.h"
- #import "AS_TabBarViewController.h"
- #import <YTKNetwork/YTKNetwork.h>
- #import <FBSDKLoginKit/FBSDKLoginKit.h>
- #import <StripeCore/StripeCore-Swift.h>
- #import <OneSignal/OneSignal.h>
- #import "AppDelegate+PushNotification.h"
- @import Stripe;
- @interface AppDelegate ()<UNUserNotificationCenterDelegate>
- //@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];
-
- //推送相关配置
- 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
|