AppDelegate.m 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // AppDelegate.m
  3. // Artimenring
  4. //
  5. // Created by BaH Cy on 14/12/16.
  6. // Copyright (c) 2014年 BaH Cy. All rights reserved.
  7. //
  8. #import "AppDelegate.h"
  9. #import "AppDelegate+sdk.h"
  10. #import "AppDelegate+login.h"
  11. #import "AppDelegate+notification.h"
  12. #import <FBSDKCoreKit/FBSDKCoreKit.h>
  13. #import <GoogleSignIn/GoogleSignIn.h>
  14. @implementation AppDelegate
  15. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  16. //NSSetUncaughtExceptionHandler(uncaughtExceptionHandler);
  17. [[UIApplication sharedApplication] delegate].window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  18. [[UIApplication sharedApplication] delegate].window.backgroundColor = [UIColor whiteColor];
  19. [[[UIApplication sharedApplication] delegate].window makeKeyAndVisible];
  20. [self initNotification:application];
  21. [AppDelegate initSdk:application didFinishLaunchingWithOptions:launchOptions];
  22. [AppDelegate monitorNetworking];
  23. [AppDelegate initIQKeyboard];
  24. [AppDelegate showAdvertising];
  25. [AppDelegate create3DTouch];
  26. [AppDelegate checkLogin];
  27. [WindowLoggerManager init];
  28. return YES;
  29. }
  30. - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  31. BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
  32. if (handled) {
  33. return YES;
  34. }
  35. #ifdef SK_DEBUG_GOOGLE_FACEBOOK
  36. handled = [GIDSignIn.sharedInstance handleURL:url];
  37. if (handled) {
  38. return YES;
  39. }
  40. #endif
  41. return YES;
  42. }
  43. - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options {
  44. #ifdef SK_DEBUG_GOOGLE_FACEBOOK
  45. return [[GIDSignIn sharedInstance] handleURL:url];
  46. #endif
  47. return YES;
  48. }
  49. - (void)applicationDidBecomeActive:(UIApplication *)application {
  50. //[FBSDKAppEvents activateApp];
  51. }
  52. @end