Guest User

AppDelegate.m

a guest
May 22nd, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  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.  
  8. #import "AppDelegate.h"
  9. #import "RNFirebaseNotifications.h"
  10. #import "RNFirebaseMessaging.h"
  11. #import <Firebase.h>
  12. #import <React/RCTBundleURLProvider.h>
  13. #import <React/RCTRootView.h>
  14.  
  15. @implementation AppDelegate
  16.  
  17. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  18. {
  19. [FIRApp configure];
  20. [RNFirebaseNotifications configure];
  21. NSURL *jsCodeLocation;
  22.  
  23. jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  24.  
  25. RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  26. moduleName:@"EverseenMobileRN"
  27. initialProperties:nil
  28. launchOptions:launchOptions];
  29. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  30.  
  31. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  32. UIViewController *rootViewController = [UIViewController new];
  33. rootViewController.view = rootView;
  34. self.window.rootViewController = rootViewController;
  35. [self.window makeKeyAndVisible];
  36. return YES;
  37. }
  38. - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  39. [[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
  40. }
  41. - (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
  42. fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
  43. [[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
  44. }
  45.  
  46. - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
  47. [[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
  48. }
  49.  
  50. @end
Advertisement
Add Comment
Please, Sign In to add comment