freerasp-react-native 1.0.0 → 2.0.0
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.
- package/LICENSE +20 -20
- package/README.md +423 -413
- package/android/build.gradle +90 -87
- package/android/gradle.properties +4 -4
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/freeraspreactnative/FreeraspDeviceStateListener.kt +25 -0
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +125 -108
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativePackage.kt +17 -17
- package/example/Gemfile +6 -6
- package/example/android/app/_BUCK +55 -55
- package/example/android/app/build.gradle +313 -313
- package/example/android/app/build_defs.bzl +19 -19
- package/example/android/app/proguard-rules.pro +10 -10
- package/example/android/app/src/debug/AndroidManifest.xml +13 -13
- package/example/android/app/src/debug/java/com/freeraspreactnativeexample/ReactNativeFlipper.java +73 -73
- package/example/android/app/src/main/AndroidManifest.xml +26 -26
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainActivity.java +48 -48
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainApplication.java +91 -91
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/MainApplicationReactNativeHost.java +116 -116
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry.java +36 -36
- package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
- package/example/android/app/src/main/jni/CMakeLists.txt +7 -7
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -32
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
- package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -65
- package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
- package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
- package/example/android/app/src/main/res/values/strings.xml +3 -3
- package/example/android/app/src/main/res/values/styles.xml +9 -9
- package/example/android/build.gradle +50 -53
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/example/android/gradle.properties +40 -40
- package/example/android/gradlew +234 -234
- package/example/android/settings.gradle +11 -11
- package/example/app.json +3 -3
- package/example/assets/checkmark-circle-outline.png +0 -0
- package/example/assets/checkmark-circle-outline.svg +1 -0
- package/example/assets/close-circle-outline.png +0 -0
- package/example/assets/close-circle-outline.svg +1 -0
- package/example/assets/talsec-logo.png +0 -0
- package/example/babel.config.js +17 -17
- package/example/index.js +5 -5
- package/example/ios/File.swift +6 -6
- package/example/ios/FreeraspReactNativeExample/AppDelegate.h +8 -8
- package/example/ios/FreeraspReactNativeExample/AppDelegate.mm +133 -133
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
- package/example/ios/FreeraspReactNativeExample/Images.xcassets/Contents.json +6 -6
- package/example/ios/FreeraspReactNativeExample/Info.plist +55 -55
- package/example/ios/FreeraspReactNativeExample/LaunchScreen.storyboard +47 -47
- package/example/ios/FreeraspReactNativeExample/main.m +10 -10
- package/example/ios/FreeraspReactNativeExample-Bridging-Header.h +3 -3
- package/example/ios/FreeraspReactNativeExample.xcodeproj/project.pbxproj +4 -2
- package/example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +88 -106
- package/example/ios/FreeraspReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -10
- package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +66 -66
- package/example/ios/FreeraspReactNativeExampleTests/Info.plist +24 -24
- package/example/ios/Podfile +43 -43
- package/example/ios/Podfile.lock +590 -584
- package/example/metro.config.js +40 -40
- package/example/package.json +24 -21
- package/example/react-native.config.js +10 -10
- package/example/src/App.tsx +136 -89
- package/example/src/DemoApp.tsx +89 -0
- package/example/src/checks.ts +16 -0
- package/example/src/styles.ts +7 -0
- package/example/yarn.lock +4644 -4154
- package/freerasp-react-native.podspec +36 -36
- package/ios/FreeraspReactNative-Bridging-Header.h +3 -3
- package/ios/FreeraspReactNative.m +14 -14
- package/ios/FreeraspReactNative.swift +62 -53
- package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme +67 -67
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/Info.plist +40 -40
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator → TalsecRuntime.xcframework/ios-arm64}/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator → TalsecRuntime.xcframework/ios-arm64}/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator → TalsecRuntime.xcframework/ios-arm64}/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +52 -51
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
- package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
- package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/curl.h +3029 -3029
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/easy.h +123 -123
- package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/mprintf.h +50 -50
- package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/multi.h +456 -456
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/system.h +504 -504
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +52 -51
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +52 -51
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
- package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/cacert.pem +3154 -3154
- package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +36 -35
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +161 -161
- package/src/index.tsx +91 -90
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +0 -25
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +0 -222
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +0 -50
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +0 -68
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +0 -33
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +0 -125
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +0 -17
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +0 -12
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -14
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +0 -450
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +0 -3029
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +0 -456
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +0 -504
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -51
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +0 -3154
- package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +0 -12
- package/ios/Release/TalsecRuntime.xcframework/Info.plist +0 -40
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +0 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +0 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +0 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -14
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +0 -25
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -23
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +0 -3029
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +0 -77
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +0 -123
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +0 -50
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +0 -456
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +0 -68
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +0 -33
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +0 -504
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +0 -125
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -51
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +0 -17
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +0 -344
- package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +0 -3154
- package/ios/TalsecRuntime.xcframework +0 -1
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
package com.freeraspreactnativeexample.newarchitecture;
|
|
2
|
-
|
|
3
|
-
import android.app.Application;
|
|
4
|
-
import androidx.annotation.NonNull;
|
|
5
|
-
import com.facebook.react.PackageList;
|
|
6
|
-
import com.facebook.react.ReactInstanceManager;
|
|
7
|
-
import com.facebook.react.ReactNativeHost;
|
|
8
|
-
import com.facebook.react.ReactPackage;
|
|
9
|
-
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
10
|
-
import com.facebook.react.bridge.JSIModulePackage;
|
|
11
|
-
import com.facebook.react.bridge.JSIModuleProvider;
|
|
12
|
-
import com.facebook.react.bridge.JSIModuleSpec;
|
|
13
|
-
import com.facebook.react.bridge.JSIModuleType;
|
|
14
|
-
import com.facebook.react.bridge.JavaScriptContextHolder;
|
|
15
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
16
|
-
import com.facebook.react.bridge.UIManager;
|
|
17
|
-
import com.facebook.react.fabric.ComponentFactory;
|
|
18
|
-
import com.facebook.react.fabric.CoreComponentsRegistry;
|
|
19
|
-
import com.facebook.react.fabric.FabricJSIModuleProvider;
|
|
20
|
-
import com.facebook.react.fabric.ReactNativeConfig;
|
|
21
|
-
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
22
|
-
import com.freeraspreactnativeexample.BuildConfig;
|
|
23
|
-
import com.freeraspreactnativeexample.newarchitecture.components.MainComponentsRegistry;
|
|
24
|
-
import com.freeraspreactnativeexample.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
|
|
25
|
-
import java.util.ArrayList;
|
|
26
|
-
import java.util.List;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
|
|
30
|
-
* TurboModule delegates and the Fabric Renderer.
|
|
31
|
-
*
|
|
32
|
-
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
33
|
-
* `newArchEnabled` property). Is ignored otherwise.
|
|
34
|
-
*/
|
|
35
|
-
public class MainApplicationReactNativeHost extends ReactNativeHost {
|
|
36
|
-
public MainApplicationReactNativeHost(Application application) {
|
|
37
|
-
super(application);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@Override
|
|
41
|
-
public boolean getUseDeveloperSupport() {
|
|
42
|
-
return BuildConfig.DEBUG;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@Override
|
|
46
|
-
protected List<ReactPackage> getPackages() {
|
|
47
|
-
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
48
|
-
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
49
|
-
// packages.add(new MyReactNativePackage());
|
|
50
|
-
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
|
|
51
|
-
// packages.add(new TurboReactPackage() { ... });
|
|
52
|
-
// If you have custom Fabric Components, their ViewManagers should also be loaded here
|
|
53
|
-
// inside a ReactPackage.
|
|
54
|
-
return packages;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@Override
|
|
58
|
-
protected String getJSMainModuleName() {
|
|
59
|
-
return "index";
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@NonNull
|
|
63
|
-
@Override
|
|
64
|
-
protected ReactPackageTurboModuleManagerDelegate.Builder
|
|
65
|
-
getReactPackageTurboModuleManagerDelegateBuilder() {
|
|
66
|
-
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
|
|
67
|
-
// for the new architecture and to use TurboModules correctly.
|
|
68
|
-
return new MainApplicationTurboModuleManagerDelegate.Builder();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@Override
|
|
72
|
-
protected JSIModulePackage getJSIModulePackage() {
|
|
73
|
-
return new JSIModulePackage() {
|
|
74
|
-
@Override
|
|
75
|
-
public List<JSIModuleSpec> getJSIModules(
|
|
76
|
-
final ReactApplicationContext reactApplicationContext,
|
|
77
|
-
final JavaScriptContextHolder jsContext) {
|
|
78
|
-
final List<JSIModuleSpec> specs = new ArrayList<>();
|
|
79
|
-
|
|
80
|
-
// Here we provide a new JSIModuleSpec that will be responsible of providing the
|
|
81
|
-
// custom Fabric Components.
|
|
82
|
-
specs.add(
|
|
83
|
-
new JSIModuleSpec() {
|
|
84
|
-
@Override
|
|
85
|
-
public JSIModuleType getJSIModuleType() {
|
|
86
|
-
return JSIModuleType.UIManager;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@Override
|
|
90
|
-
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
|
|
91
|
-
final ComponentFactory componentFactory = new ComponentFactory();
|
|
92
|
-
CoreComponentsRegistry.register(componentFactory);
|
|
93
|
-
|
|
94
|
-
// Here we register a Components Registry.
|
|
95
|
-
// The one that is generated with the template contains no components
|
|
96
|
-
// and just provides you the one from React Native core.
|
|
97
|
-
MainComponentsRegistry.register(componentFactory);
|
|
98
|
-
|
|
99
|
-
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
|
|
100
|
-
|
|
101
|
-
ViewManagerRegistry viewManagerRegistry =
|
|
102
|
-
new ViewManagerRegistry(
|
|
103
|
-
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
|
|
104
|
-
|
|
105
|
-
return new FabricJSIModuleProvider(
|
|
106
|
-
reactApplicationContext,
|
|
107
|
-
componentFactory,
|
|
108
|
-
ReactNativeConfig.DEFAULT_CONFIG,
|
|
109
|
-
viewManagerRegistry);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
return specs;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
1
|
+
package com.freeraspreactnativeexample.newarchitecture;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import androidx.annotation.NonNull;
|
|
5
|
+
import com.facebook.react.PackageList;
|
|
6
|
+
import com.facebook.react.ReactInstanceManager;
|
|
7
|
+
import com.facebook.react.ReactNativeHost;
|
|
8
|
+
import com.facebook.react.ReactPackage;
|
|
9
|
+
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
10
|
+
import com.facebook.react.bridge.JSIModulePackage;
|
|
11
|
+
import com.facebook.react.bridge.JSIModuleProvider;
|
|
12
|
+
import com.facebook.react.bridge.JSIModuleSpec;
|
|
13
|
+
import com.facebook.react.bridge.JSIModuleType;
|
|
14
|
+
import com.facebook.react.bridge.JavaScriptContextHolder;
|
|
15
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
16
|
+
import com.facebook.react.bridge.UIManager;
|
|
17
|
+
import com.facebook.react.fabric.ComponentFactory;
|
|
18
|
+
import com.facebook.react.fabric.CoreComponentsRegistry;
|
|
19
|
+
import com.facebook.react.fabric.FabricJSIModuleProvider;
|
|
20
|
+
import com.facebook.react.fabric.ReactNativeConfig;
|
|
21
|
+
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
22
|
+
import com.freeraspreactnativeexample.BuildConfig;
|
|
23
|
+
import com.freeraspreactnativeexample.newarchitecture.components.MainComponentsRegistry;
|
|
24
|
+
import com.freeraspreactnativeexample.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
|
|
25
|
+
import java.util.ArrayList;
|
|
26
|
+
import java.util.List;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
|
|
30
|
+
* TurboModule delegates and the Fabric Renderer.
|
|
31
|
+
*
|
|
32
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
33
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
34
|
+
*/
|
|
35
|
+
public class MainApplicationReactNativeHost extends ReactNativeHost {
|
|
36
|
+
public MainApplicationReactNativeHost(Application application) {
|
|
37
|
+
super(application);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public boolean getUseDeveloperSupport() {
|
|
42
|
+
return BuildConfig.DEBUG;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Override
|
|
46
|
+
protected List<ReactPackage> getPackages() {
|
|
47
|
+
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
48
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
49
|
+
// packages.add(new MyReactNativePackage());
|
|
50
|
+
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
|
|
51
|
+
// packages.add(new TurboReactPackage() { ... });
|
|
52
|
+
// If you have custom Fabric Components, their ViewManagers should also be loaded here
|
|
53
|
+
// inside a ReactPackage.
|
|
54
|
+
return packages;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Override
|
|
58
|
+
protected String getJSMainModuleName() {
|
|
59
|
+
return "index";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@NonNull
|
|
63
|
+
@Override
|
|
64
|
+
protected ReactPackageTurboModuleManagerDelegate.Builder
|
|
65
|
+
getReactPackageTurboModuleManagerDelegateBuilder() {
|
|
66
|
+
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
|
|
67
|
+
// for the new architecture and to use TurboModules correctly.
|
|
68
|
+
return new MainApplicationTurboModuleManagerDelegate.Builder();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@Override
|
|
72
|
+
protected JSIModulePackage getJSIModulePackage() {
|
|
73
|
+
return new JSIModulePackage() {
|
|
74
|
+
@Override
|
|
75
|
+
public List<JSIModuleSpec> getJSIModules(
|
|
76
|
+
final ReactApplicationContext reactApplicationContext,
|
|
77
|
+
final JavaScriptContextHolder jsContext) {
|
|
78
|
+
final List<JSIModuleSpec> specs = new ArrayList<>();
|
|
79
|
+
|
|
80
|
+
// Here we provide a new JSIModuleSpec that will be responsible of providing the
|
|
81
|
+
// custom Fabric Components.
|
|
82
|
+
specs.add(
|
|
83
|
+
new JSIModuleSpec() {
|
|
84
|
+
@Override
|
|
85
|
+
public JSIModuleType getJSIModuleType() {
|
|
86
|
+
return JSIModuleType.UIManager;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@Override
|
|
90
|
+
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
|
|
91
|
+
final ComponentFactory componentFactory = new ComponentFactory();
|
|
92
|
+
CoreComponentsRegistry.register(componentFactory);
|
|
93
|
+
|
|
94
|
+
// Here we register a Components Registry.
|
|
95
|
+
// The one that is generated with the template contains no components
|
|
96
|
+
// and just provides you the one from React Native core.
|
|
97
|
+
MainComponentsRegistry.register(componentFactory);
|
|
98
|
+
|
|
99
|
+
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
|
|
100
|
+
|
|
101
|
+
ViewManagerRegistry viewManagerRegistry =
|
|
102
|
+
new ViewManagerRegistry(
|
|
103
|
+
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
|
|
104
|
+
|
|
105
|
+
return new FabricJSIModuleProvider(
|
|
106
|
+
reactApplicationContext,
|
|
107
|
+
componentFactory,
|
|
108
|
+
ReactNativeConfig.DEFAULT_CONFIG,
|
|
109
|
+
viewManagerRegistry);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return specs;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
package com.freeraspreactnativeexample.newarchitecture.components;
|
|
2
|
-
|
|
3
|
-
import com.facebook.jni.HybridData;
|
|
4
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
5
|
-
import com.facebook.react.fabric.ComponentFactory;
|
|
6
|
-
import com.facebook.soloader.SoLoader;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
|
|
10
|
-
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
11
|
-
* folder for you).
|
|
12
|
-
*
|
|
13
|
-
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
14
|
-
* `newArchEnabled` property). Is ignored otherwise.
|
|
15
|
-
*/
|
|
16
|
-
@DoNotStrip
|
|
17
|
-
public class MainComponentsRegistry {
|
|
18
|
-
static {
|
|
19
|
-
SoLoader.loadLibrary("fabricjni");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@DoNotStrip private final HybridData mHybridData;
|
|
23
|
-
|
|
24
|
-
@DoNotStrip
|
|
25
|
-
private native HybridData initHybrid(ComponentFactory componentFactory);
|
|
26
|
-
|
|
27
|
-
@DoNotStrip
|
|
28
|
-
private MainComponentsRegistry(ComponentFactory componentFactory) {
|
|
29
|
-
mHybridData = initHybrid(componentFactory);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@DoNotStrip
|
|
33
|
-
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
|
|
34
|
-
return new MainComponentsRegistry(componentFactory);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
package com.freeraspreactnativeexample.newarchitecture.components;
|
|
2
|
+
|
|
3
|
+
import com.facebook.jni.HybridData;
|
|
4
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
5
|
+
import com.facebook.react.fabric.ComponentFactory;
|
|
6
|
+
import com.facebook.soloader.SoLoader;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
|
|
10
|
+
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
11
|
+
* folder for you).
|
|
12
|
+
*
|
|
13
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
14
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
public class MainComponentsRegistry {
|
|
18
|
+
static {
|
|
19
|
+
SoLoader.loadLibrary("fabricjni");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@DoNotStrip private final HybridData mHybridData;
|
|
23
|
+
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
private native HybridData initHybrid(ComponentFactory componentFactory);
|
|
26
|
+
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
private MainComponentsRegistry(ComponentFactory componentFactory) {
|
|
29
|
+
mHybridData = initHybrid(componentFactory);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
|
|
34
|
+
return new MainComponentsRegistry(componentFactory);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
package com.freeraspreactnativeexample.newarchitecture.modules;
|
|
2
|
-
|
|
3
|
-
import com.facebook.jni.HybridData;
|
|
4
|
-
import com.facebook.react.ReactPackage;
|
|
5
|
-
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.soloader.SoLoader;
|
|
8
|
-
import java.util.List;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Class responsible to load the TurboModules. This class has native methods and needs a
|
|
12
|
-
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
13
|
-
* folder for you).
|
|
14
|
-
*
|
|
15
|
-
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
16
|
-
* `newArchEnabled` property). Is ignored otherwise.
|
|
17
|
-
*/
|
|
18
|
-
public class MainApplicationTurboModuleManagerDelegate
|
|
19
|
-
extends ReactPackageTurboModuleManagerDelegate {
|
|
20
|
-
|
|
21
|
-
private static volatile boolean sIsSoLibraryLoaded;
|
|
22
|
-
|
|
23
|
-
protected MainApplicationTurboModuleManagerDelegate(
|
|
24
|
-
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
|
|
25
|
-
super(reactApplicationContext, packages);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
protected native HybridData initHybrid();
|
|
29
|
-
|
|
30
|
-
native boolean canCreateTurboModule(String moduleName);
|
|
31
|
-
|
|
32
|
-
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
|
|
33
|
-
protected MainApplicationTurboModuleManagerDelegate build(
|
|
34
|
-
ReactApplicationContext context, List<ReactPackage> packages) {
|
|
35
|
-
return new MainApplicationTurboModuleManagerDelegate(context, packages);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@Override
|
|
40
|
-
protected synchronized void maybeLoadOtherSoLibraries() {
|
|
41
|
-
if (!sIsSoLibraryLoaded) {
|
|
42
|
-
// If you change the name of your application .so file in the Android.mk file,
|
|
43
|
-
// make sure you update the name here as well.
|
|
44
|
-
SoLoader.loadLibrary("freeraspreactnativeexample_appmodules");
|
|
45
|
-
sIsSoLibraryLoaded = true;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
package com.freeraspreactnativeexample.newarchitecture.modules;
|
|
2
|
+
|
|
3
|
+
import com.facebook.jni.HybridData;
|
|
4
|
+
import com.facebook.react.ReactPackage;
|
|
5
|
+
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
+
import com.facebook.soloader.SoLoader;
|
|
8
|
+
import java.util.List;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Class responsible to load the TurboModules. This class has native methods and needs a
|
|
12
|
+
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
|
13
|
+
* folder for you).
|
|
14
|
+
*
|
|
15
|
+
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
|
16
|
+
* `newArchEnabled` property). Is ignored otherwise.
|
|
17
|
+
*/
|
|
18
|
+
public class MainApplicationTurboModuleManagerDelegate
|
|
19
|
+
extends ReactPackageTurboModuleManagerDelegate {
|
|
20
|
+
|
|
21
|
+
private static volatile boolean sIsSoLibraryLoaded;
|
|
22
|
+
|
|
23
|
+
protected MainApplicationTurboModuleManagerDelegate(
|
|
24
|
+
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
|
|
25
|
+
super(reactApplicationContext, packages);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
protected native HybridData initHybrid();
|
|
29
|
+
|
|
30
|
+
native boolean canCreateTurboModule(String moduleName);
|
|
31
|
+
|
|
32
|
+
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
|
|
33
|
+
protected MainApplicationTurboModuleManagerDelegate build(
|
|
34
|
+
ReactApplicationContext context, List<ReactPackage> packages) {
|
|
35
|
+
return new MainApplicationTurboModuleManagerDelegate(context, packages);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Override
|
|
40
|
+
protected synchronized void maybeLoadOtherSoLibraries() {
|
|
41
|
+
if (!sIsSoLibraryLoaded) {
|
|
42
|
+
// If you change the name of your application .so file in the Android.mk file,
|
|
43
|
+
// make sure you update the name here as well.
|
|
44
|
+
SoLoader.loadLibrary("freeraspreactnativeexample_appmodules");
|
|
45
|
+
sIsSoLibraryLoaded = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
cmake_minimum_required(VERSION 3.13)
|
|
2
|
-
|
|
3
|
-
# Define the library name here.
|
|
4
|
-
project(freeraspreactnativeexample_appmodules)
|
|
5
|
-
|
|
6
|
-
# This file includes all the necessary to let you build your application with the New Architecture.
|
|
7
|
-
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
|
|
1
|
+
cmake_minimum_required(VERSION 3.13)
|
|
2
|
+
|
|
3
|
+
# Define the library name here.
|
|
4
|
+
project(freeraspreactnativeexample_appmodules)
|
|
5
|
+
|
|
6
|
+
# This file includes all the necessary to let you build your application with the New Architecture.
|
|
7
|
+
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
#include "MainApplicationModuleProvider.h"
|
|
2
|
-
|
|
3
|
-
#include <rncli.h>
|
|
4
|
-
#include <rncore.h>
|
|
5
|
-
|
|
6
|
-
namespace facebook {
|
|
7
|
-
namespace react {
|
|
8
|
-
|
|
9
|
-
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
10
|
-
const std::string &moduleName,
|
|
11
|
-
const JavaTurboModule::InitParams ¶ms) {
|
|
12
|
-
// Here you can provide your own module provider for TurboModules coming from
|
|
13
|
-
// either your application or from external libraries. The approach to follow
|
|
14
|
-
// is similar to the following (for a library called `samplelibrary`:
|
|
15
|
-
//
|
|
16
|
-
// auto module = samplelibrary_ModuleProvider(moduleName, params);
|
|
17
|
-
// if (module != nullptr) {
|
|
18
|
-
// return module;
|
|
19
|
-
// }
|
|
20
|
-
// return rncore_ModuleProvider(moduleName, params);
|
|
21
|
-
|
|
22
|
-
// Module providers autolinked by RN CLI
|
|
23
|
-
auto rncli_module = rncli_ModuleProvider(moduleName, params);
|
|
24
|
-
if (rncli_module != nullptr) {
|
|
25
|
-
return rncli_module;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return rncore_ModuleProvider(moduleName, params);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
} // namespace react
|
|
32
|
-
} // namespace facebook
|
|
1
|
+
#include "MainApplicationModuleProvider.h"
|
|
2
|
+
|
|
3
|
+
#include <rncli.h>
|
|
4
|
+
#include <rncore.h>
|
|
5
|
+
|
|
6
|
+
namespace facebook {
|
|
7
|
+
namespace react {
|
|
8
|
+
|
|
9
|
+
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
10
|
+
const std::string &moduleName,
|
|
11
|
+
const JavaTurboModule::InitParams ¶ms) {
|
|
12
|
+
// Here you can provide your own module provider for TurboModules coming from
|
|
13
|
+
// either your application or from external libraries. The approach to follow
|
|
14
|
+
// is similar to the following (for a library called `samplelibrary`:
|
|
15
|
+
//
|
|
16
|
+
// auto module = samplelibrary_ModuleProvider(moduleName, params);
|
|
17
|
+
// if (module != nullptr) {
|
|
18
|
+
// return module;
|
|
19
|
+
// }
|
|
20
|
+
// return rncore_ModuleProvider(moduleName, params);
|
|
21
|
+
|
|
22
|
+
// Module providers autolinked by RN CLI
|
|
23
|
+
auto rncli_module = rncli_ModuleProvider(moduleName, params);
|
|
24
|
+
if (rncli_module != nullptr) {
|
|
25
|
+
return rncli_module;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return rncore_ModuleProvider(moduleName, params);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
} // namespace react
|
|
32
|
+
} // namespace facebook
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
|
|
6
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
7
|
-
|
|
8
|
-
namespace facebook {
|
|
9
|
-
namespace react {
|
|
10
|
-
|
|
11
|
-
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
12
|
-
const std::string &moduleName,
|
|
13
|
-
const JavaTurboModule::InitParams ¶ms);
|
|
14
|
-
|
|
15
|
-
} // namespace react
|
|
16
|
-
} // namespace facebook
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <memory>
|
|
4
|
+
#include <string>
|
|
5
|
+
|
|
6
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
7
|
+
|
|
8
|
+
namespace facebook {
|
|
9
|
+
namespace react {
|
|
10
|
+
|
|
11
|
+
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|
12
|
+
const std::string &moduleName,
|
|
13
|
+
const JavaTurboModule::InitParams ¶ms);
|
|
14
|
+
|
|
15
|
+
} // namespace react
|
|
16
|
+
} // namespace facebook
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
#include "MainApplicationTurboModuleManagerDelegate.h"
|
|
2
|
-
#include "MainApplicationModuleProvider.h"
|
|
3
|
-
|
|
4
|
-
namespace facebook {
|
|
5
|
-
namespace react {
|
|
6
|
-
|
|
7
|
-
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
|
|
8
|
-
MainApplicationTurboModuleManagerDelegate::initHybrid(
|
|
9
|
-
jni::alias_ref<jhybridobject>) {
|
|
10
|
-
return makeCxxInstance();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
|
|
14
|
-
registerHybrid({
|
|
15
|
-
makeNativeMethod(
|
|
16
|
-
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
|
|
17
|
-
makeNativeMethod(
|
|
18
|
-
"canCreateTurboModule",
|
|
19
|
-
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
std::shared_ptr<TurboModule>
|
|
24
|
-
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
25
|
-
const std::string &name,
|
|
26
|
-
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
27
|
-
// Not implemented yet: provide pure-C++ NativeModules here.
|
|
28
|
-
return nullptr;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
std::shared_ptr<TurboModule>
|
|
32
|
-
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
33
|
-
const std::string &name,
|
|
34
|
-
const JavaTurboModule::InitParams ¶ms) {
|
|
35
|
-
return MainApplicationModuleProvider(name, params);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
|
39
|
-
const std::string &name) {
|
|
40
|
-
return getTurboModule(name, nullptr) != nullptr ||
|
|
41
|
-
getTurboModule(name, {.moduleName = name}) != nullptr;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
} // namespace react
|
|
45
|
-
} // namespace facebook
|
|
1
|
+
#include "MainApplicationTurboModuleManagerDelegate.h"
|
|
2
|
+
#include "MainApplicationModuleProvider.h"
|
|
3
|
+
|
|
4
|
+
namespace facebook {
|
|
5
|
+
namespace react {
|
|
6
|
+
|
|
7
|
+
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
|
|
8
|
+
MainApplicationTurboModuleManagerDelegate::initHybrid(
|
|
9
|
+
jni::alias_ref<jhybridobject>) {
|
|
10
|
+
return makeCxxInstance();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
|
|
14
|
+
registerHybrid({
|
|
15
|
+
makeNativeMethod(
|
|
16
|
+
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
|
|
17
|
+
makeNativeMethod(
|
|
18
|
+
"canCreateTurboModule",
|
|
19
|
+
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
std::shared_ptr<TurboModule>
|
|
24
|
+
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
25
|
+
const std::string &name,
|
|
26
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
27
|
+
// Not implemented yet: provide pure-C++ NativeModules here.
|
|
28
|
+
return nullptr;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
std::shared_ptr<TurboModule>
|
|
32
|
+
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
|
33
|
+
const std::string &name,
|
|
34
|
+
const JavaTurboModule::InitParams ¶ms) {
|
|
35
|
+
return MainApplicationModuleProvider(name, params);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
|
39
|
+
const std::string &name) {
|
|
40
|
+
return getTurboModule(name, nullptr) != nullptr ||
|
|
41
|
+
getTurboModule(name, {.moduleName = name}) != nullptr;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
} // namespace react
|
|
45
|
+
} // namespace facebook
|