|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`withReactNativeFeatureFlagsIOS generates RNFeatureFlagsOverride.h 1`] = ` |
| 4 | +"// This file is generated by @config-plugins/react-native-feature-flags. |
| 5 | +// Do not edit manually. |
| 6 | +
|
| 7 | +#ifndef RNFeatureFlagsOverride_h |
| 8 | +#define RNFeatureFlagsOverride_h |
| 9 | +
|
| 10 | +#ifdef __cplusplus |
| 11 | +extern "C" { |
| 12 | +#endif |
| 13 | +
|
| 14 | +void RNFeatureFlagsOverride_apply(void); |
| 15 | +
|
| 16 | +#ifdef __cplusplus |
| 17 | +} |
| 18 | +#endif |
| 19 | +
|
| 20 | +#endif |
| 21 | +" |
| 22 | +`; |
| 23 | + |
| 24 | +exports[`withReactNativeFeatureFlagsIOS generates RNFeatureFlagsOverride.mm 1`] = ` |
| 25 | +"// This file is generated by @config-plugins/react-native-feature-flags. |
| 26 | +// Do not edit manually. |
| 27 | +
|
| 28 | +#import <react/featureflags/ReactNativeFeatureFlags.h> |
| 29 | +#import <react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h> |
| 30 | +
|
| 31 | +class RNFeatureFlagsOverrideProvider : public facebook::react::ReactNativeFeatureFlagsOverridesOSSStable { |
| 32 | + public: |
| 33 | + bool fuseboxFrameRecordingEnabled() override { return true; } |
| 34 | + bool enableMicrotasks() override { return false; } |
| 35 | +}; |
| 36 | +
|
| 37 | +extern "C" void RNFeatureFlagsOverride_apply() { |
| 38 | + facebook::react::ReactNativeFeatureFlags::dangerouslyForceOverride( |
| 39 | + std::make_unique<RNFeatureFlagsOverrideProvider>()); |
| 40 | +} |
| 41 | +" |
| 42 | +`; |
| 43 | + |
| 44 | +exports[`withReactNativeFeatureFlagsIOS inserts override call into Swift AppDelegate 1`] = ` |
| 45 | +"import Expo |
| 46 | +import React |
| 47 | +import ReactAppDependencyProvider |
| 48 | +
|
| 49 | +@UIApplicationMain |
| 50 | +public class AppDelegate: ExpoAppDelegate { |
| 51 | + var window: UIWindow? |
| 52 | +
|
| 53 | + var reactNativeDelegate: ExpoReactNativeFactoryDelegate? |
| 54 | + var reactNativeFactory: RCTReactNativeFactory? |
| 55 | +
|
| 56 | + public override func application( |
| 57 | + _ application: UIApplication, |
| 58 | + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil |
| 59 | + ) -> Bool { |
| 60 | + let delegate = ReactNativeDelegate() |
| 61 | + let factory = ExpoReactNativeFactory(delegate: delegate) |
| 62 | + delegate.dependencyProvider = RCTAppDependencyProvider() |
| 63 | +
|
| 64 | + reactNativeDelegate = delegate |
| 65 | + reactNativeFactory = factory |
| 66 | +// @generated begin rn-feature-flags-override - expo prebuild (DO NOT MODIFY) sync-8c8ed3ba25ac045452a092474dc8e34a460529c1 |
| 67 | + RNFeatureFlagsOverride_apply() |
| 68 | +// @generated end rn-feature-flags-override |
| 69 | +
|
| 70 | +#if os(iOS) || os(tvOS) |
| 71 | + window = UIWindow(frame: UIScreen.main.bounds) |
| 72 | + factory.startReactNative( |
| 73 | + withModuleName: "main", |
| 74 | + in: window, |
| 75 | + launchOptions: launchOptions) |
| 76 | +#endif |
| 77 | +
|
| 78 | + return super.application(application, didFinishLaunchingWithOptions: launchOptions) |
| 79 | + } |
| 80 | +
|
| 81 | + // Linking API |
| 82 | + public override func application( |
| 83 | + _ app: UIApplication, |
| 84 | + open url: URL, |
| 85 | + options: [UIApplication.OpenURLOptionsKey: Any] = [:] |
| 86 | + ) -> Bool { |
| 87 | + return super.application(app, open: url, options: options) || RCTLinkingManager.application(app, open: url, options: options) |
| 88 | + } |
| 89 | +
|
| 90 | + // Universal Links |
| 91 | + public override func application( |
| 92 | + _ application: UIApplication, |
| 93 | + continue userActivity: NSUserActivity, |
| 94 | + restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void |
| 95 | + ) -> Bool { |
| 96 | + let result = RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler) |
| 97 | + return super.application(application, continue: userActivity, restorationHandler: restorationHandler) || result |
| 98 | + } |
| 99 | +} |
| 100 | +
|
| 101 | +class ReactNativeDelegate: ExpoReactNativeFactoryDelegate { |
| 102 | + // Extension point for config-plugins |
| 103 | +
|
| 104 | + override func sourceURL(for bridge: RCTBridge) -> URL? { |
| 105 | + // needed to return the correct URL for expo-dev-client. |
| 106 | + bridge.bundleURL ?? bundleURL() |
| 107 | + } |
| 108 | +
|
| 109 | + override func bundleURL() -> URL? { |
| 110 | +#if DEBUG |
| 111 | + return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: ".expo/.virtual-metro-entry") |
| 112 | +#else |
| 113 | + return Bundle.main.url(forResource: "main", withExtension: "jsbundle") |
| 114 | +#endif |
| 115 | + } |
| 116 | +} |
| 117 | +" |
| 118 | +`; |
0 commit comments