Skip to content

Commit

Permalink
Add expo updated workaround to the example iOS app to make sure it do…
Browse files Browse the repository at this point in the history
…esn't crash
  • Loading branch information
ospfranco committed Jan 26, 2025
1 parent a63c5d0 commit 56c66b3
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions example/ios/OPSQLiteExample/AppDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
#import "AppDelegate.h"

#import "OPSQLite.h"
#import <React/RCTBundleURLProvider.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"OPSQLiteExample";
return [super application:application didFinishLaunchingWithOptions:launchOptions];
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.moduleName = @"OPSQLiteExample";
[OPSQLite expoUpdatesWorkaround];
return [super application:application
didFinishLaunchingWithOptions:launchOptions];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [self bundleURL];
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
return [self bundleURL];
}

- (NSURL *)bundleURL
{
- (NSURL *)bundleURL {
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
return [[RCTBundleURLProvider sharedSettings]
jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
return [[NSBundle mainBundle] URLForResource:@"main"
withExtension:@"jsbundle"];
#endif
}

/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
/// This method controls whether the `concurrentRoot`feature of React18 is
/// turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
return true;
/// @note: This requires to be rendering on Fabric (i.e. on the New
/// Architecture).
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it
/// returns `false`.
- (BOOL)concurrentRootEnabled {
return true;
}

-(BOOL)bridgelessEnabled
{
return YES;
- (BOOL)bridgelessEnabled {
return YES;
}

@end

0 comments on commit 56c66b3

Please sign in to comment.