File tree 2 files changed +8
-20
lines changed
2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change 1
1
#import < React/RCTBridgeModule.h>
2
- #import " react-native-get-random-values.h"
3
2
4
3
@interface RNGetRandomValues : NSObject <RCTBridgeModule>
5
4
6
- @property (nonatomic , assign ) BOOL setBridgeOnMainQueue;
7
-
8
5
@end
Original file line number Diff line number Diff line change 6
6
7
7
@implementation RNGetRandomValues
8
8
9
- @synthesize bridge = _bridge;
10
- @synthesize methodQueue = _methodQueue;
11
-
12
9
RCT_EXPORT_MODULE ();
13
10
14
- + (BOOL )requiresMainQueueSetup {
15
- return YES ;
16
- }
17
-
18
- - (void )setBridge : (RCTBridge *)bridge {
19
- _bridge = bridge;
20
- _setBridgeOnMainQueue = RCTIsMainQueue ();
21
- [self installLibrary ];
22
- }
23
-
24
- - (void )installLibrary {
25
- RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge ;
11
+ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD (install) {
12
+ RCTBridge* bridge = [RCTBridge currentBridge ];
13
+ RCTCxxBridge* cxxBridge = (RCTCxxBridge*)bridge;
26
14
27
- if (cxxBridge.runtime ) {
15
+ if (cxxBridge.runtime ) {
28
16
reactnativegetrandomvalues::install (*(facebook::jsi::Runtime *)cxxBridge.runtime );
29
- }
17
+ return @true ;
18
+ }
19
+
20
+ return @false ;
30
21
}
31
22
32
23
@end
You can’t perform that action at this time.
0 commit comments