Skip to content

Commit e931a5a

Browse files
committed
fix: ios turbomodule and make backwards-compatible
1 parent f6ed7de commit e931a5a

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

example/ios/Podfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ENV['RCT_NEW_ARCH_ENABLED'] = '1'
2+
13
# Resolve react_native_pods.rb with node to allow for hoisting
24
require Pod::Executable.execute_command('node', ['-p',
35
'require.resolve(

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,6 @@ SPEC CHECKSUMS:
19061906
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
19071907
Yoga: a1d7895431387402a674fd0d1c04ec85e87909b8
19081908

1909-
PODFILE CHECKSUM: 4bce8267d9986e5cfbfb8604f802585607b49854
1909+
PODFILE CHECKSUM: c6724dc625a6aa9f3f0577b2c2d3f9b39ece8968
19101910

19111911
COCOAPODS: 1.15.2

package/ios/QuickSQLite.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
#ifdef RCT_NEW_ARCH_ENABLED
12
#import <RNQuickSQLite/RNQuickSQLite.h>
23

34
NS_ASSUME_NONNULL_BEGIN
45

5-
@interface RNQuickSQLiteModule : NSObject <NativeRNQuickSQLiteModuleSpec>
6+
@interface RNQuickSQLiteModule : NSObject<NativeRNQuickSQLiteModuleSpec>
7+
#else
8+
#import <React/RCTBridge.h>
9+
10+
@interface RNQuickSQLiteModule : NSObject<RCTBridgeModule>
11+
#endif
612

713
@property(nonatomic, assign) BOOL setBridgeOnMainQueue;
814

915
@end
1016

17+
#ifdef RCT_NEW_ARCH_ENABLED
1118
NS_ASSUME_NONNULL_END
19+
#endif

package/ios/QuickSQLite.mm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@
99

1010
@implementation RNQuickSQLiteModule
1111

12+
RCT_EXPORT_MODULE()
13+
1214
@synthesize bridge = _bridge;
1315

16+
#if RCT_NEW_ARCH_ENABLED
17+
1418
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
1519
(const facebook::react::ObjCTurboModule::InitParams &)params
1620
{
1721
return std::make_shared<facebook::react::NativeRNQuickSQLiteModuleSpecJSI>(params);
1822
}
1923

20-
- (NSNumber *) install {
24+
#endif
25+
26+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
2127
NSLog(@"Installing RNQuickSQLite module...");
2228

2329
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge;

0 commit comments

Comments
 (0)