AppDelegate.m 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import "AppDelegate.h"
  8. #import <React/RCTBridge.h>
  9. #import <React/RCTBundleURLProvider.h>
  10. #import <React/RCTRootView.h>
  11. #import <KakaoOpenSDK/KakaoOpenSDK.h>
  12. #import <FBSDKCoreKit/FBSDKCoreKit.h>
  13. @implementation AppDelegate
  14. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  15. {
  16. RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  17. RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
  18. moduleName:@"emptyapp"
  19. initialProperties:nil];
  20. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  21. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  22. UIViewController *rootViewController = [UIViewController new];
  23. rootViewController.view = rootView;
  24. self.window.rootViewController = rootViewController;
  25. [self.window makeKeyAndVisible];
  26. return YES;
  27. }
  28. - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  29. sourceApplication:(NSString *)sourceApplication
  30. annotation:(id)annotation {
  31. if ([KOSession isKakaoAccountLoginCallback:url]) {
  32. return [KOSession handleOpenURL:url];
  33. }
  34. return false;
  35. }
  36. - (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options {
  37. if ([KOSession isKakaoAccountLoginCallback:url]) {
  38. return [KOSession handleOpenURL:url];
  39. }
  40. return [[FBSDKApplicationDelegate sharedInstance]
  41. application:application
  42. openURL:url
  43. sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
  44. annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
  45. }
  46. - (void)applicationDidBecomeActive:(UIApplication *)application
  47. {
  48. [KOSession handleDidBecomeActive];
  49. }
  50. - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
  51. {
  52. #if DEBUG
  53. return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  54. #else
  55. return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  56. #endif
  57. }
  58. @end