Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Copyright (c) 2015-present, Facebook, Inc.
  3.  * All rights reserved.
  4.  *
  5.  * This source code is licensed under the BSD-style license found in the
  6.  * LICENSE file in the root directory of this source tree. An additional grant
  7.  * of patent rights can be found in the PATENTS file in the same directory.
  8.  */
  9. #import "AppDelegate.h"
  10.  
  11. #import <React/RCTBundleURLProvider.h>
  12. #import <React/RCTRootView.h>
  13.  
  14. #import <FBSDKCoreKit/FBSDKCoreKit.h>
  15. #import <FBSDKLoginKit/FBSDKLoginKit.h>
  16. #import <React/RCTPushNotificationManager.h>
  17.  
  18. #import <PhotoEditorSDK/PhotoEditorSDK.h>
  19.  
  20. @implementation AppDelegate
  21.  
  22. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  23. {
  24.   NSURL *jsCodeLocation;
  25.  
  26.   jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
  27.  
  28.   RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  29.                                                       moduleName:@"ZodioApp"
  30.                                                initialProperties:nil
  31.                                                    launchOptions:launchOptions];
  32.   rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  33.  
  34.   self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  35.   UIViewController *rootViewController = [UIViewController new];
  36.   rootViewController.view = rootView;
  37.   self.window.rootViewController = rootViewController;
  38.   [self.window makeKeyAndVisible];
  39.  
  40.  
  41.  
  42.   [[FBSDKApplicationDelegate sharedInstance] application:application
  43.                                     didFinishLaunchingWithOptions:launchOptions];
  44.   [PESDK unlockWithLicenseAt:[[NSBundle mainBundle] URLForResource:@"LICENSE_IOS" withExtension:nil]];
  45.  
  46.   return YES;
  47. }
  48.  
  49. // Facebook SDK
  50. - (void)applicationDidBecomeActive:(UIApplication *)application {
  51.   [FBSDKAppEvents activateApp];
  52. }
  53.  
  54. - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  55.   return [[FBSDKApplicationDelegate sharedInstance] application:application
  56.                                                         openURL:url
  57.                                               sourceApplication:sourceApplication
  58.                                                      annotation:annotation];
  59. }
  60.  
  61. // Required to register for notifications
  62.  - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
  63.  {
  64.   [RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings];
  65.  }
  66.  // Required for the register event.
  67.  - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
  68.  {
  69.   [RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
  70.  }
  71.  // Required for the notification event. You must call the completion handler after handling the remote notification.
  72.  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
  73.                                                         fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
  74.  {
  75.    [RCTPushNotificationManager didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
  76.  }
  77.  // Required for the registrationError event.
  78.  - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
  79.  {
  80.   [RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error];
  81.  }
  82.  // Required for the localNotification event.
  83.  - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
  84.  {
  85.   [RCTPushNotificationManager didReceiveLocalNotification:notification];
  86.  }
  87.  
  88. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement