-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from OP-Engineering/expo-updates-workaround
Add new expoUpdatesWorkaround function to avoid expo-updates crashing
- Loading branch information
Showing
6 changed files
with
165 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,7 @@ | ||
// #ifdef RCT_NEW_ARCH_ENABLED | ||
// #import <OPSQLiteSpec/OPSQLiteSpec.h> | ||
// #else | ||
#import <React/RCTBridge.h> | ||
// #endif | ||
|
||
@interface OPSQLite : NSObject | ||
// #ifdef RCT_NEW_ARCH_ENABLED | ||
// <NativeOPSQLiteSpec> | ||
// #else | ||
<RCTBridgeModule> | ||
// #endif | ||
@interface OPSQLite : NSObject <RCTBridgeModule> | ||
|
||
@property(nonatomic, assign) BOOL setBridgeOnMainQueue; | ||
|
||
+ (void)expoUpdatesWorkaround; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters