// // AppDelegate.m // NatureDemo // // Created by SAGESSE on 2019/1/20. // Copyright © 2019 SAGESSE. All rights reserved. // #import "AppDelegate.h" #import #import #import "XenonSDK.h" #import "MLAdManager.h" @interface AppDelegate () @end @implementation AppDelegate //#define T_FOREACH_ARGC_(_0,_1,_2,_3,_4,_5,_6,_7,N,...) N //#define T_FOREACH_ARGC(...) T_FOREACH_ARGC_(0, ##__VA_ARGS__, 7,6,5,4,3,2,1,0) // //#define T_FOREACH_1(F,N,_1) F(_1) //#define T_FOREACH_2(F,N,_1,_2) T_FOREACH_1(F,N,_1) N F(_2) //#define T_FOREACH_3(F,N,_1,_2,_3) T_FOREACH_2(F,N,_1,_2) N F(_3) //#define T_FOREACH_4(F,N,_1,_2,_3,_4) T_FOREACH_3(F,N,_1,_2,_3) N F(_4) //#define T_FOREACH_5(F,N,_1,_2,_3,_4,_5) T_FOREACH_4(F,N,_1,_2,_3,_4) N F(_5) //#define T_FOREACH_6(F,N,_1,_2,_3,_4,_5,_6) T_FOREACH_5(F,N,_1,_2,_3,_4,_5) N F(_6) //#define T_FOREACH_7(F,N,_1,_2,_3,_4,_5,_6,_7) T_FOREACH_6(F,N,_1,_2,_3,_4,_5,_6) N F(_7) // //#define T_FOREACH_CONCAT_(A, B) A ## B //#define T_FOREACH_CONCAT(A, B) T_FOREACH_CONCAT_(A, B) // //#define T_FOREACH(F, N, ...) T_FOREACH_CONCAT(T_FOREACH_, T_FOREACH_ARGC(__VA_ARGS__))(F, N, __VA_ARGS__) // //#define T_FORMATS_U(P) @#P"=%@" //#define T_FORMATS(...) T_FOREACH(T_FORMATS_U, ", ", ##__VA_ARGS__) // //#define T(...) NSLog(@"%s " T_FORMATS(__VA_ARGS__), __func__, __VA_ARGS__) - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. //1.facebook SDK init // [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; // NSLog(@"%s %@", __func__, [(id)(NSClassFromString(@"XCBundle") ?: NSBundle.mainBundle) bundlePath]); // T(self, application, launchOptions); // [XenonSDK.sharedSDK initWithParameter:@"20387|1105|673842&gfqkhIOS_IOS_0001" complete:^(NSError * error1) { //检查是否有漏单 //[XenonSDK.sharedSDK checkOrderStatus]; //登录 if (error1 == nil) { [XenonSDK.sharedSDK hAutoWithComplete:^(id user, NSError *error) { NSLog(@"user==%@",user); NSLog(@"自动登录error==%@",error); }]; }else{ NSLog(@"SDK初始化失败,error1==%@",error1); } }]; //1.设置window的rootViewController. // if (self.window == nil) { // UIWindow *keyWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; // [keyWindow makeKeyAndVisible]; // self.window = keyWindow; // self.window.rootViewController = [self rootViewController]; // } //2. 穿山甲广告 SDK init [XenonSDK.sharedSDK CSJAdSDKinit]; //3. 穿山甲开屏广告测试 // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [XenonSDK.sharedSDK openBUDSplashAd:@"splash001" callback:^(BOOL ready) { // // if (ready) { // NSLog(@"[穿山甲广告]result:开屏广告加载成功!"); // }else{ // NSLog(@"[穿山甲广告]result:开屏广告加载失败!"); // } // }]; // }); //4. 优量汇广告 SDK init // [XenonSDK.sharedSDK YLHAdSDKinit]; //开屏广告测试 // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [XenonSDK.sharedSDK openYLHSplashAd:@"YLH_splash001" supportZoomoutView:NO callback:^(BOOL ready) { // if (ready) { // NSLog(@"[优量汇广告]result:开屏广告加载成功!"); // }else{ // NSLog(@"[优量汇广告]result:开屏广告加载失败!"); // } // }]; // }); //5. TopOn广告 SDK init // [XenonSDK.sharedSDK TopOnAdSDKinit]; //TopOn开屏广告测试 // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [XenonSDK.sharedSDK openTOPONSplashAd:@"TopOnsplash001" callback:^(BOOL ready) { // if (ready) { // NSLog(@"[TopOn广告]result:开屏广告加载成功!"); // }else{ // NSLog(@"[TopOn广告]result:开屏广告加载失败!"); // } // }]; // }); return YES; } #pragma mark - Test //- (UIViewController *)rootViewController { // //主页面 // KWBUDAdmobFullScreenCusEventVC *mainViewController = [[KWBUDAdmobFullScreenCusEventVC alloc] init]; //Main VC // UINavigationController *navigationVC = [[UINavigationController alloc] initWithRootViewController:mainViewController]; // return navigationVC; //} - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(nonnull NSDictionary *)options { //facebook SDK [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url options:options]; return YES; } #pragma mark - ===========applicationWillResignActive================ - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } //设置成横屏. //- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ // if (window.rootViewController.presentedViewController.parentViewController != nil) { // return UIInterfaceOrientationMaskAll; // } // return UIInterfaceOrientationMaskLandscape; //} @end