@openwallet-foundation/askar-react-native 0.6.0 → 0.6.1-alpha-20260609123727
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,7 +38,7 @@ public class AskarModule extends ReactContextBaseJavaModule {
|
|
|
38
38
|
try {
|
|
39
39
|
ReactContext context = getReactApplicationContext();
|
|
40
40
|
long jsContextPointer = context.getJavaScriptContextHolder().get();
|
|
41
|
-
CallInvokerHolderImpl holder = (CallInvokerHolderImpl) context.
|
|
41
|
+
CallInvokerHolderImpl holder = (CallInvokerHolderImpl) context.getJSCallInvokerHolder();
|
|
42
42
|
installNative(jsContextPointer, holder);
|
|
43
43
|
return true;
|
|
44
44
|
} catch (Exception exception) {
|
package/ios/Askar.mm
CHANGED
|
@@ -2,31 +2,57 @@
|
|
|
2
2
|
#import <jsi/jsi.h>
|
|
3
3
|
#import <React/RCTUtils.h>
|
|
4
4
|
#import <ReactCommon/RCTTurboModule.h>
|
|
5
|
+
#import <ReactCommon/RCTInteropTurboModule.h>
|
|
6
|
+
#import <ReactCommon/RCTTurboModuleWithJSIBindings.h>
|
|
5
7
|
#import <askar/turboModuleUtility.h>
|
|
6
8
|
|
|
7
9
|
#import "Askar.h"
|
|
8
10
|
|
|
9
11
|
using namespace facebook;
|
|
10
12
|
|
|
13
|
+
@interface Askar () <RCTTurboModule, RCTTurboModuleWithJSIBindings>
|
|
14
|
+
@end
|
|
15
|
+
|
|
11
16
|
@implementation Askar
|
|
12
17
|
|
|
13
18
|
RCT_EXPORT_MODULE()
|
|
14
19
|
|
|
20
|
+
// Expose this module as a TurboModule so React Native invokes
|
|
21
|
+
// installJSIBindingsWithRuntime:callInvoker: below when the module is created.
|
|
22
|
+
// This is the only supported way to install JSI bindings under the New
|
|
23
|
+
// Architecture / bridgeless mode, where [RCTBridge currentBridge] is nil and
|
|
24
|
+
// the legacy bridge is compiled out (RCT_REMOVE_LEGACY_ARCH=1).
|
|
25
|
+
//
|
|
26
|
+
// ObjCInteropTurboModule keeps the existing RCT_EXPORT methods (e.g. `install`)
|
|
27
|
+
// dispatchable without requiring a codegen spec, so this remains a drop-in
|
|
28
|
+
// change that also works on the old architecture.
|
|
29
|
+
- (std::shared_ptr<react::TurboModule>)getTurboModule:(const react::ObjCTurboModule::InitParams &)params
|
|
30
|
+
{
|
|
31
|
+
return std::make_shared<react::ObjCInteropTurboModule>(params);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
- (void)installJSIBindingsWithRuntime:(jsi::Runtime &)runtime
|
|
35
|
+
callInvoker:(const std::shared_ptr<react::CallInvoker> &)callInvoker
|
|
36
|
+
{
|
|
37
|
+
askarTurboModuleUtility::registerTurboModule(runtime, callInvoker);
|
|
38
|
+
}
|
|
39
|
+
|
|
15
40
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install)
|
|
16
41
|
{
|
|
42
|
+
// New Architecture: the JSI bindings are installed via
|
|
43
|
+
// installJSIBindingsWithRuntime:callInvoker: when this TurboModule is
|
|
44
|
+
// created, so there is nothing to do here.
|
|
45
|
+
//
|
|
46
|
+
// Old Architecture (legacy bridge present): install using the bridge
|
|
47
|
+
// runtime so this keeps working for non-bridgeless apps.
|
|
17
48
|
RCTBridge* bridge = [RCTBridge currentBridge];
|
|
18
49
|
RCTCxxBridge* cxxBridge = (RCTCxxBridge*)bridge;
|
|
19
|
-
if (cxxBridge
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (jsiRuntime == nil) {
|
|
25
|
-
return @false;
|
|
50
|
+
if (cxxBridge != nil) {
|
|
51
|
+
jsi::Runtime* jsiRuntime = (jsi::Runtime*) cxxBridge.runtime;
|
|
52
|
+
if (jsiRuntime != nil) {
|
|
53
|
+
askarTurboModuleUtility::registerTurboModule(*jsiRuntime, bridge.jsCallInvoker);
|
|
54
|
+
}
|
|
26
55
|
}
|
|
27
|
-
|
|
28
|
-
auto callInvoker = bridge.jsCallInvoker;
|
|
29
|
-
askarTurboModuleUtility::registerTurboModule(*jsiRuntime, callInvoker);
|
|
30
56
|
return @true;
|
|
31
57
|
}
|
|
32
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openwallet-foundation/askar-react-native",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1-alpha-20260609123727",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "React Native wrapper for Askar",
|
|
6
6
|
"main": "build/index",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"scripts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@openwallet-foundation/askar-shared": "0.6.
|
|
33
|
+
"@openwallet-foundation/askar-shared": "0.6.1-alpha-20260609123727"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"react": "18.2.0",
|