|
1 | 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
|
2 | 2 |
|
3 |
| -exports[`Config Plugin iOS Tests tests changes made to AppDelegate.m 1`] = ` |
4 |
| -"#import \\"AppDelegate.h\\" |
| 3 | +exports[`Config Plugin iOS Tests tests changes made to AppDelegate.m (SDK 43+) 1`] = ` |
| 4 | +"// This AppDelegate template is used in Expo SDK 43 and newer |
| 5 | +// It is (nearly) identical to the pure template used when |
| 6 | +// creating a bare React Native app (without Expo) |
| 7 | +
|
| 8 | +#import \\"AppDelegate.h\\" |
| 9 | +@import Firebase; |
| 10 | +
|
| 11 | +#import <React/RCTBridge.h> |
| 12 | +#import <React/RCTBundleURLProvider.h> |
| 13 | +#import <React/RCTRootView.h> |
| 14 | +#import <React/RCTLinkingManager.h> |
| 15 | +#import <React/RCTConvert.h> |
| 16 | +
|
| 17 | +#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>) |
| 18 | +#import <FlipperKit/FlipperClient.h> |
| 19 | +#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h> |
| 20 | +#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h> |
| 21 | +#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h> |
| 22 | +#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h> |
| 23 | +#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h> |
| 24 | +
|
| 25 | +static void InitializeFlipper(UIApplication *application) { |
| 26 | + FlipperClient *client = [FlipperClient sharedClient]; |
| 27 | + SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; |
| 28 | + [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; |
| 29 | + [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; |
| 30 | + [client addPlugin:[FlipperKitReactPlugin new]]; |
| 31 | + [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; |
| 32 | + [client start]; |
| 33 | +} |
| 34 | +#endif |
| 35 | +
|
| 36 | +@implementation AppDelegate |
| 37 | +
|
| 38 | +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| 39 | +{ |
| 40 | +#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>) |
| 41 | + InitializeFlipper(application); |
| 42 | +#endif |
| 43 | + |
| 44 | +// @generated begin @react-native-firebase/app-didFinishLaunchingWithOptions - expo prebuild (DO NOT MODIFY) sync-ecd111c37e49fdd1ed6354203cd6b1e2a38cccda |
| 45 | +[FIRApp configure]; |
| 46 | +// @generated end @react-native-firebase/app-didFinishLaunchingWithOptions |
| 47 | + RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; |
| 48 | + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@\\"main\\" initialProperties:nil]; |
| 49 | + id rootViewBackgroundColor = [[NSBundle mainBundle] objectForInfoDictionaryKey:@\\"RCTRootViewBackgroundColor\\"]; |
| 50 | + if (rootViewBackgroundColor != nil) { |
| 51 | + rootView.backgroundColor = [RCTConvert UIColor:rootViewBackgroundColor]; |
| 52 | + } else { |
| 53 | + rootView.backgroundColor = [UIColor whiteColor]; |
| 54 | + } |
| 55 | +
|
| 56 | + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; |
| 57 | + UIViewController *rootViewController = [UIViewController new]; |
| 58 | + rootViewController.view = rootView; |
| 59 | + self.window.rootViewController = rootViewController; |
| 60 | + [self.window makeKeyAndVisible]; |
| 61 | +
|
| 62 | + [super application:application didFinishLaunchingWithOptions:launchOptions]; |
| 63 | +
|
| 64 | + return YES; |
| 65 | + } |
| 66 | +
|
| 67 | +- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge |
| 68 | +{ |
| 69 | + // If you'd like to export some custom RCTBridgeModules, add them here! |
| 70 | + return @[]; |
| 71 | +} |
| 72 | +
|
| 73 | +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { |
| 74 | + #ifdef DEBUG |
| 75 | + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\\"index\\" fallbackResource:nil]; |
| 76 | + #else |
| 77 | + return [[NSBundle mainBundle] URLForResource:@\\"main\\" withExtension:@\\"jsbundle\\"]; |
| 78 | + #endif |
| 79 | +} |
| 80 | +
|
| 81 | +// Linking API |
| 82 | +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { |
| 83 | + return [RCTLinkingManager application:application openURL:url options:options]; |
| 84 | +} |
| 85 | +
|
| 86 | +// Universal Links |
| 87 | +- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { |
| 88 | + return [RCTLinkingManager application:application |
| 89 | + continueUserActivity:userActivity |
| 90 | + restorationHandler:restorationHandler]; |
| 91 | +} |
| 92 | +
|
| 93 | +@end |
| 94 | +" |
| 95 | +`; |
| 96 | +
|
| 97 | +exports[`Config Plugin iOS Tests tests changes made to old AppDelegate.m (SDK 42) 1`] = ` |
| 98 | +"// This AppDelegate prebuild template is used in Expo SDK 42 and older |
| 99 | +// It expects the old react-native-unimodules architecture (UM* prefix) |
| 100 | +
|
| 101 | +#import \\"AppDelegate.h\\" |
5 | 102 | @import Firebase;
|
6 | 103 |
|
7 | 104 | #import <React/RCTBridge.h>
|
@@ -49,7 +146,9 @@ static void InitializeFlipper(UIApplication *application) {
|
49 | 146 | InitializeFlipper(application);
|
50 | 147 | #endif
|
51 | 148 |
|
52 |
| - [FIRApp configure]; |
| 149 | +// @generated begin @react-native-firebase/app-didFinishLaunchingWithOptions - expo prebuild (DO NOT MODIFY) sync-ecd111c37e49fdd1ed6354203cd6b1e2a38cccda |
| 150 | +[FIRApp configure]; |
| 151 | +// @generated end @react-native-firebase/app-didFinishLaunchingWithOptions |
53 | 152 | self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
|
54 | 153 | self.launchOptions = launchOptions;
|
55 | 154 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
0 commit comments