freerasp-react-native 1.0.0 → 1.1.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.
Files changed (159) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +442 -413
  3. package/android/build.gradle +87 -87
  4. package/android/gradle.properties +4 -4
  5. package/android/src/main/AndroidManifest.xml +4 -4
  6. package/android/src/main/java/com/freeraspreactnative/FreeraspDeviceStateListener.kt +25 -0
  7. package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +113 -108
  8. package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativePackage.kt +17 -17
  9. package/example/Gemfile +6 -6
  10. package/example/android/app/_BUCK +55 -55
  11. package/example/android/app/build.gradle +313 -313
  12. package/example/android/app/build_defs.bzl +19 -19
  13. package/example/android/app/proguard-rules.pro +10 -10
  14. package/example/android/app/src/debug/AndroidManifest.xml +13 -13
  15. package/example/android/app/src/debug/java/com/freeraspreactnativeexample/ReactNativeFlipper.java +73 -73
  16. package/example/android/app/src/main/AndroidManifest.xml +26 -26
  17. package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainActivity.java +48 -48
  18. package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainApplication.java +91 -91
  19. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/MainApplicationReactNativeHost.java +116 -116
  20. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry.java +36 -36
  21. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
  22. package/example/android/app/src/main/jni/CMakeLists.txt +7 -7
  23. package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -32
  24. package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
  25. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
  26. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
  27. package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -65
  28. package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
  29. package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
  30. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
  31. package/example/android/app/src/main/res/values/strings.xml +3 -3
  32. package/example/android/app/src/main/res/values/styles.xml +9 -9
  33. package/example/android/build.gradle +53 -53
  34. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  35. package/example/android/gradle.properties +40 -40
  36. package/example/android/gradlew +234 -234
  37. package/example/android/settings.gradle +11 -11
  38. package/example/app.json +3 -3
  39. package/example/assets/checkmark-circle-outline.png +0 -0
  40. package/example/assets/checkmark-circle-outline.svg +1 -0
  41. package/example/assets/close-circle-outline.png +0 -0
  42. package/example/assets/close-circle-outline.svg +1 -0
  43. package/example/assets/talsec-logo.png +0 -0
  44. package/example/babel.config.js +17 -17
  45. package/example/index.js +5 -5
  46. package/example/ios/File.swift +6 -6
  47. package/example/ios/FreeraspReactNativeExample/AppDelegate.h +8 -8
  48. package/example/ios/FreeraspReactNativeExample/AppDelegate.mm +133 -133
  49. package/example/ios/FreeraspReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
  50. package/example/ios/FreeraspReactNativeExample/Images.xcassets/Contents.json +6 -6
  51. package/example/ios/FreeraspReactNativeExample/Info.plist +55 -55
  52. package/example/ios/FreeraspReactNativeExample/LaunchScreen.storyboard +47 -47
  53. package/example/ios/FreeraspReactNativeExample/main.m +10 -10
  54. package/example/ios/FreeraspReactNativeExample-Bridging-Header.h +3 -3
  55. package/example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +106 -106
  56. package/example/ios/FreeraspReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -10
  57. package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  58. package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +66 -66
  59. package/example/ios/FreeraspReactNativeExampleTests/Info.plist +24 -24
  60. package/example/ios/Podfile +43 -43
  61. package/example/ios/Podfile.lock +590 -584
  62. package/example/metro.config.js +40 -40
  63. package/example/package.json +24 -21
  64. package/example/react-native.config.js +10 -10
  65. package/example/src/App.tsx +135 -89
  66. package/example/src/DemoApp.tsx +89 -0
  67. package/example/src/checks.ts +16 -0
  68. package/example/src/styles.ts +7 -0
  69. package/example/yarn.lock +4644 -4154
  70. package/freerasp-react-native.podspec +36 -36
  71. package/ios/Debug/TalsecRuntime.xcframework/Info.plist +40 -40
  72. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  73. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  74. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
  75. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  76. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  77. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
  78. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
  79. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  80. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
  81. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
  82. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  83. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
  84. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  85. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
  86. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  87. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  88. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
  89. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
  90. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  91. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  92. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
  93. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  94. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  95. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
  96. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
  97. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  98. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
  99. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
  100. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  101. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
  102. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  103. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
  104. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
  105. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  106. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  107. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
  108. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
  109. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
  110. package/ios/FreeraspReactNative-Bridging-Header.h +3 -3
  111. package/ios/FreeraspReactNative.m +14 -14
  112. package/ios/FreeraspReactNative.swift +57 -53
  113. package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme +67 -67
  114. package/ios/Release/TalsecRuntime.xcframework/Info.plist +40 -40
  115. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  116. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  117. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
  118. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  119. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  120. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
  121. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
  122. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  123. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
  124. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
  125. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  126. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
  127. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  128. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
  129. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  130. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  131. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
  132. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
  133. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  134. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  135. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
  136. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  137. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  138. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
  139. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
  140. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  141. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
  142. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
  143. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  144. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
  145. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  146. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
  147. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
  148. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  149. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  150. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
  151. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
  152. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
  153. package/lib/commonjs/index.js.map +1 -1
  154. package/lib/module/index.js.map +1 -1
  155. package/lib/typescript/index.d.ts +35 -35
  156. package/lib/typescript/index.d.ts.map +1 -1
  157. package/package.json +161 -161
  158. package/src/index.tsx +90 -90
  159. package/ios/TalsecRuntime.xcframework +0 -1
@@ -1,133 +1,133 @@
1
- #import "AppDelegate.h"
2
-
3
- #import <React/RCTBridge.h>
4
- #import <React/RCTBundleURLProvider.h>
5
- #import <React/RCTRootView.h>
6
-
7
- #import <React/RCTAppSetupUtils.h>
8
-
9
- #if RCT_NEW_ARCH_ENABLED
10
- #import <React/CoreModulesPlugins.h>
11
- #import <React/RCTCxxBridgeDelegate.h>
12
- #import <React/RCTFabricSurfaceHostingProxyRootView.h>
13
- #import <React/RCTSurfacePresenter.h>
14
- #import <React/RCTSurfacePresenterBridgeAdapter.h>
15
- #import <ReactCommon/RCTTurboModuleManager.h>
16
-
17
- #import <react/config/ReactNativeConfig.h>
18
-
19
- static NSString *const kRNConcurrentRoot = @"concurrentRoot";
20
-
21
- @interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
22
- RCTTurboModuleManager *_turboModuleManager;
23
- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
24
- std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
25
- facebook::react::ContextContainer::Shared _contextContainer;
26
- }
27
- @end
28
- #endif
29
-
30
- @implementation AppDelegate
31
-
32
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
33
- {
34
- RCTAppSetupPrepareApp(application);
35
-
36
- RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
37
-
38
- #if RCT_NEW_ARCH_ENABLED
39
- _contextContainer = std::make_shared<facebook::react::ContextContainer const>();
40
- _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
41
- _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
42
- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
43
- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
44
- #endif
45
-
46
- NSDictionary *initProps = [self prepareInitialProps];
47
- UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"FreeraspReactNativeExample", initProps);
48
-
49
- if (@available(iOS 13.0, *)) {
50
- rootView.backgroundColor = [UIColor systemBackgroundColor];
51
- } else {
52
- rootView.backgroundColor = [UIColor whiteColor];
53
- }
54
-
55
- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
56
- UIViewController *rootViewController = [UIViewController new];
57
- rootViewController.view = rootView;
58
- self.window.rootViewController = rootViewController;
59
- [self.window makeKeyAndVisible];
60
- return YES;
61
- }
62
-
63
- /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
64
- ///
65
- /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
66
- /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
67
- /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
68
- - (BOOL)concurrentRootEnabled
69
- {
70
- // Switch this bool to turn on and off the concurrent root
71
- return true;
72
- }
73
-
74
- - (NSDictionary *)prepareInitialProps
75
- {
76
- NSMutableDictionary *initProps = [NSMutableDictionary new];
77
-
78
- #ifdef RCT_NEW_ARCH_ENABLED
79
- initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
80
- #endif
81
-
82
- return initProps;
83
- }
84
-
85
- - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
86
- {
87
- #if DEBUG
88
- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
89
- #else
90
- return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
91
- #endif
92
- }
93
-
94
- #if RCT_NEW_ARCH_ENABLED
95
-
96
- #pragma mark - RCTCxxBridgeDelegate
97
-
98
- - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
99
- {
100
- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
101
- delegate:self
102
- jsInvoker:bridge.jsCallInvoker];
103
- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
104
- }
105
-
106
- #pragma mark RCTTurboModuleManagerDelegate
107
-
108
- - (Class)getModuleClassFromName:(const char *)name
109
- {
110
- return RCTCoreModulesClassProvider(name);
111
- }
112
-
113
- - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
114
- jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
115
- {
116
- return nullptr;
117
- }
118
-
119
- - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
120
- initParams:
121
- (const facebook::react::ObjCTurboModule::InitParams &)params
122
- {
123
- return nullptr;
124
- }
125
-
126
- - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
127
- {
128
- return RCTAppSetupDefaultModuleFromClass(moduleClass);
129
- }
130
-
131
- #endif
132
-
133
- @end
1
+ #import "AppDelegate.h"
2
+
3
+ #import <React/RCTBridge.h>
4
+ #import <React/RCTBundleURLProvider.h>
5
+ #import <React/RCTRootView.h>
6
+
7
+ #import <React/RCTAppSetupUtils.h>
8
+
9
+ #if RCT_NEW_ARCH_ENABLED
10
+ #import <React/CoreModulesPlugins.h>
11
+ #import <React/RCTCxxBridgeDelegate.h>
12
+ #import <React/RCTFabricSurfaceHostingProxyRootView.h>
13
+ #import <React/RCTSurfacePresenter.h>
14
+ #import <React/RCTSurfacePresenterBridgeAdapter.h>
15
+ #import <ReactCommon/RCTTurboModuleManager.h>
16
+
17
+ #import <react/config/ReactNativeConfig.h>
18
+
19
+ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
20
+
21
+ @interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
22
+ RCTTurboModuleManager *_turboModuleManager;
23
+ RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
24
+ std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
25
+ facebook::react::ContextContainer::Shared _contextContainer;
26
+ }
27
+ @end
28
+ #endif
29
+
30
+ @implementation AppDelegate
31
+
32
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
33
+ {
34
+ RCTAppSetupPrepareApp(application);
35
+
36
+ RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
37
+
38
+ #if RCT_NEW_ARCH_ENABLED
39
+ _contextContainer = std::make_shared<facebook::react::ContextContainer const>();
40
+ _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
41
+ _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
42
+ _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
43
+ bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
44
+ #endif
45
+
46
+ NSDictionary *initProps = [self prepareInitialProps];
47
+ UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"FreeraspReactNativeExample", initProps);
48
+
49
+ if (@available(iOS 13.0, *)) {
50
+ rootView.backgroundColor = [UIColor systemBackgroundColor];
51
+ } else {
52
+ rootView.backgroundColor = [UIColor whiteColor];
53
+ }
54
+
55
+ self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
56
+ UIViewController *rootViewController = [UIViewController new];
57
+ rootViewController.view = rootView;
58
+ self.window.rootViewController = rootViewController;
59
+ [self.window makeKeyAndVisible];
60
+ return YES;
61
+ }
62
+
63
+ /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
64
+ ///
65
+ /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
66
+ /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
67
+ /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
68
+ - (BOOL)concurrentRootEnabled
69
+ {
70
+ // Switch this bool to turn on and off the concurrent root
71
+ return true;
72
+ }
73
+
74
+ - (NSDictionary *)prepareInitialProps
75
+ {
76
+ NSMutableDictionary *initProps = [NSMutableDictionary new];
77
+
78
+ #ifdef RCT_NEW_ARCH_ENABLED
79
+ initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
80
+ #endif
81
+
82
+ return initProps;
83
+ }
84
+
85
+ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
86
+ {
87
+ #if DEBUG
88
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
89
+ #else
90
+ return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
91
+ #endif
92
+ }
93
+
94
+ #if RCT_NEW_ARCH_ENABLED
95
+
96
+ #pragma mark - RCTCxxBridgeDelegate
97
+
98
+ - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
99
+ {
100
+ _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
101
+ delegate:self
102
+ jsInvoker:bridge.jsCallInvoker];
103
+ return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
104
+ }
105
+
106
+ #pragma mark RCTTurboModuleManagerDelegate
107
+
108
+ - (Class)getModuleClassFromName:(const char *)name
109
+ {
110
+ return RCTCoreModulesClassProvider(name);
111
+ }
112
+
113
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
114
+ jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
115
+ {
116
+ return nullptr;
117
+ }
118
+
119
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
120
+ initParams:
121
+ (const facebook::react::ObjCTurboModule::InitParams &)params
122
+ {
123
+ return nullptr;
124
+ }
125
+
126
+ - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
127
+ {
128
+ return RCTAppSetupDefaultModuleFromClass(moduleClass);
129
+ }
130
+
131
+ #endif
132
+
133
+ @end
@@ -1,53 +1,53 @@
1
- {
2
- "images" : [
3
- {
4
- "idiom" : "iphone",
5
- "scale" : "2x",
6
- "size" : "20x20"
7
- },
8
- {
9
- "idiom" : "iphone",
10
- "scale" : "3x",
11
- "size" : "20x20"
12
- },
13
- {
14
- "idiom" : "iphone",
15
- "scale" : "2x",
16
- "size" : "29x29"
17
- },
18
- {
19
- "idiom" : "iphone",
20
- "scale" : "3x",
21
- "size" : "29x29"
22
- },
23
- {
24
- "idiom" : "iphone",
25
- "scale" : "2x",
26
- "size" : "40x40"
27
- },
28
- {
29
- "idiom" : "iphone",
30
- "scale" : "3x",
31
- "size" : "40x40"
32
- },
33
- {
34
- "idiom" : "iphone",
35
- "scale" : "2x",
36
- "size" : "60x60"
37
- },
38
- {
39
- "idiom" : "iphone",
40
- "scale" : "3x",
41
- "size" : "60x60"
42
- },
43
- {
44
- "idiom" : "ios-marketing",
45
- "scale" : "1x",
46
- "size" : "1024x1024"
47
- }
48
- ],
49
- "info" : {
50
- "author" : "xcode",
51
- "version" : 1
52
- }
53
- }
1
+ {
2
+ "images" : [
3
+ {
4
+ "idiom" : "iphone",
5
+ "scale" : "2x",
6
+ "size" : "20x20"
7
+ },
8
+ {
9
+ "idiom" : "iphone",
10
+ "scale" : "3x",
11
+ "size" : "20x20"
12
+ },
13
+ {
14
+ "idiom" : "iphone",
15
+ "scale" : "2x",
16
+ "size" : "29x29"
17
+ },
18
+ {
19
+ "idiom" : "iphone",
20
+ "scale" : "3x",
21
+ "size" : "29x29"
22
+ },
23
+ {
24
+ "idiom" : "iphone",
25
+ "scale" : "2x",
26
+ "size" : "40x40"
27
+ },
28
+ {
29
+ "idiom" : "iphone",
30
+ "scale" : "3x",
31
+ "size" : "40x40"
32
+ },
33
+ {
34
+ "idiom" : "iphone",
35
+ "scale" : "2x",
36
+ "size" : "60x60"
37
+ },
38
+ {
39
+ "idiom" : "iphone",
40
+ "scale" : "3x",
41
+ "size" : "60x60"
42
+ },
43
+ {
44
+ "idiom" : "ios-marketing",
45
+ "scale" : "1x",
46
+ "size" : "1024x1024"
47
+ }
48
+ ],
49
+ "info" : {
50
+ "author" : "xcode",
51
+ "version" : 1
52
+ }
53
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "info" : {
3
- "version" : 1,
4
- "author" : "xcode"
5
- }
6
- }
1
+ {
2
+ "info" : {
3
+ "version" : 1,
4
+ "author" : "xcode"
5
+ }
6
+ }
@@ -1,55 +1,55 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>en</string>
7
- <key>CFBundleDisplayName</key>
8
- <string>FreeraspReactNativeExample</string>
9
- <key>CFBundleExecutable</key>
10
- <string>$(EXECUTABLE_NAME)</string>
11
- <key>CFBundleIdentifier</key>
12
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
- <key>CFBundleInfoDictionaryVersion</key>
14
- <string>6.0</string>
15
- <key>CFBundleName</key>
16
- <string>$(PRODUCT_NAME)</string>
17
- <key>CFBundlePackageType</key>
18
- <string>APPL</string>
19
- <key>CFBundleShortVersionString</key>
20
- <string>1.0</string>
21
- <key>CFBundleSignature</key>
22
- <string>????</string>
23
- <key>CFBundleVersion</key>
24
- <string>1</string>
25
- <key>LSRequiresIPhoneOS</key>
26
- <true/>
27
- <key>NSAppTransportSecurity</key>
28
- <dict>
29
- <key>NSExceptionDomains</key>
30
- <dict>
31
- <key>localhost</key>
32
- <dict>
33
- <key>NSExceptionAllowsInsecureHTTPLoads</key>
34
- <true/>
35
- </dict>
36
- </dict>
37
- </dict>
38
- <key>NSLocationWhenInUseUsageDescription</key>
39
- <string></string>
40
- <key>UILaunchStoryboardName</key>
41
- <string>LaunchScreen</string>
42
- <key>UIRequiredDeviceCapabilities</key>
43
- <array>
44
- <string>armv7</string>
45
- </array>
46
- <key>UISupportedInterfaceOrientations</key>
47
- <array>
48
- <string>UIInterfaceOrientationPortrait</string>
49
- <string>UIInterfaceOrientationLandscapeLeft</string>
50
- <string>UIInterfaceOrientationLandscapeRight</string>
51
- </array>
52
- <key>UIViewControllerBasedStatusBarAppearance</key>
53
- <false/>
54
- </dict>
55
- </plist>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleDisplayName</key>
8
+ <string>FreeraspReactNativeExample</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>$(EXECUTABLE_NAME)</string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>$(PRODUCT_NAME)</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleShortVersionString</key>
20
+ <string>1.0</string>
21
+ <key>CFBundleSignature</key>
22
+ <string>????</string>
23
+ <key>CFBundleVersion</key>
24
+ <string>1</string>
25
+ <key>LSRequiresIPhoneOS</key>
26
+ <true/>
27
+ <key>NSAppTransportSecurity</key>
28
+ <dict>
29
+ <key>NSExceptionDomains</key>
30
+ <dict>
31
+ <key>localhost</key>
32
+ <dict>
33
+ <key>NSExceptionAllowsInsecureHTTPLoads</key>
34
+ <true/>
35
+ </dict>
36
+ </dict>
37
+ </dict>
38
+ <key>NSLocationWhenInUseUsageDescription</key>
39
+ <string></string>
40
+ <key>UILaunchStoryboardName</key>
41
+ <string>LaunchScreen</string>
42
+ <key>UIRequiredDeviceCapabilities</key>
43
+ <array>
44
+ <string>armv7</string>
45
+ </array>
46
+ <key>UISupportedInterfaceOrientations</key>
47
+ <array>
48
+ <string>UIInterfaceOrientationPortrait</string>
49
+ <string>UIInterfaceOrientationLandscapeLeft</string>
50
+ <string>UIInterfaceOrientationLandscapeRight</string>
51
+ </array>
52
+ <key>UIViewControllerBasedStatusBarAppearance</key>
53
+ <false/>
54
+ </dict>
55
+ </plist>
@@ -1,47 +1,47 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3
- <device id="retina4_7" orientation="portrait" appearance="light"/>
4
- <dependencies>
5
- <deployment identifier="iOS"/>
6
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
7
- <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8
- <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
- </dependencies>
10
- <scenes>
11
- <!--View Controller-->
12
- <scene sceneID="EHf-IW-A2E">
13
- <objects>
14
- <viewController id="01J-lp-oVM" sceneMemberID="viewController">
15
- <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16
- <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
17
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18
- <subviews>
19
- <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FreeraspReactNativeExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
20
- <rect key="frame" x="0.0" y="202" width="375" height="43"/>
21
- <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
22
- <nil key="highlightedColor"/>
23
- </label>
24
- <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
25
- <rect key="frame" x="0.0" y="626" width="375" height="21"/>
26
- <fontDescription key="fontDescription" type="system" pointSize="17"/>
27
- <nil key="highlightedColor"/>
28
- </label>
29
- </subviews>
30
- <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
31
- <constraints>
32
- <constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
33
- <constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
34
- <constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
35
- <constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
36
- <constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
37
- <constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
38
- </constraints>
39
- <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
40
- </view>
41
- </viewController>
42
- <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
43
- </objects>
44
- <point key="canvasLocation" x="52.173913043478265" y="375"/>
45
- </scene>
46
- </scenes>
47
- </document>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3
+ <device id="retina4_7" orientation="portrait" appearance="light"/>
4
+ <dependencies>
5
+ <deployment identifier="iOS"/>
6
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
7
+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
+ </dependencies>
10
+ <scenes>
11
+ <!--View Controller-->
12
+ <scene sceneID="EHf-IW-A2E">
13
+ <objects>
14
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
15
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16
+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
17
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18
+ <subviews>
19
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FreeraspReactNativeExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
20
+ <rect key="frame" x="0.0" y="202" width="375" height="43"/>
21
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
22
+ <nil key="highlightedColor"/>
23
+ </label>
24
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
25
+ <rect key="frame" x="0.0" y="626" width="375" height="21"/>
26
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
27
+ <nil key="highlightedColor"/>
28
+ </label>
29
+ </subviews>
30
+ <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
31
+ <constraints>
32
+ <constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
33
+ <constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
34
+ <constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
35
+ <constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
36
+ <constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
37
+ <constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
38
+ </constraints>
39
+ <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
40
+ </view>
41
+ </viewController>
42
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
43
+ </objects>
44
+ <point key="canvasLocation" x="52.173913043478265" y="375"/>
45
+ </scene>
46
+ </scenes>
47
+ </document>
@@ -1,10 +1,10 @@
1
- #import <UIKit/UIKit.h>
2
-
3
- #import "AppDelegate.h"
4
-
5
- int main(int argc, char *argv[])
6
- {
7
- @autoreleasepool {
8
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9
- }
10
- }
1
+ #import <UIKit/UIKit.h>
2
+
3
+ #import "AppDelegate.h"
4
+
5
+ int main(int argc, char *argv[])
6
+ {
7
+ @autoreleasepool {
8
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9
+ }
10
+ }
@@ -1,3 +1,3 @@
1
- //
2
- // Use this file to import your target's public headers that you would like to expose to Swift.
3
- //
1
+ //
2
+ // Use this file to import your target's public headers that you would like to expose to Swift.
3
+ //