react-native-plaid-link-sdk 12.8.2 → 13.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.
Files changed (183) hide show
  1. package/.eslintrc.js +5 -0
  2. package/.gitattributes +3 -0
  3. package/.nvmrc +1 -0
  4. package/CHANGELOG.md +1458 -0
  5. package/README.md +17 -277
  6. package/V13_MIGRATION_GUIDE.md +470 -0
  7. package/android/build.gradle +30 -98
  8. package/android/src/main/AndroidManifest.xml +1 -8
  9. package/android/src/main/java/expo/modules/plaidlinksdk/PlaidEmbeddedResultDispatcher.kt +19 -0
  10. package/android/src/main/java/expo/modules/plaidlinksdk/PlaidResultMappers.kt +217 -0
  11. package/android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt +5 -0
  12. package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkModule.kt +183 -0
  13. package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkView.kt +69 -0
  14. package/build/PlaidEmbeddedSearchView.d.ts +12 -0
  15. package/build/PlaidEmbeddedSearchView.d.ts.map +1 -0
  16. package/build/PlaidEmbeddedSearchView.js +8 -0
  17. package/build/PlaidEmbeddedSearchView.js.map +1 -0
  18. package/{dist/src/Types.d.ts → build/ReactNativePlaidLinkSdk.types.d.ts} +78 -47
  19. package/build/ReactNativePlaidLinkSdk.types.d.ts.map +1 -0
  20. package/{dist/build → build}/ReactNativePlaidLinkSdk.types.js +82 -71
  21. package/build/ReactNativePlaidLinkSdk.types.js.map +1 -0
  22. package/build/ReactNativePlaidLinkSdkModule.d.ts +16 -0
  23. package/build/ReactNativePlaidLinkSdkModule.d.ts.map +1 -0
  24. package/{dist/build → build}/ReactNativePlaidLinkSdkModule.js +1 -1
  25. package/build/ReactNativePlaidLinkSdkModule.js.map +1 -0
  26. package/build/index.d.ts +13 -0
  27. package/build/index.d.ts.map +1 -0
  28. package/build/index.js +134 -0
  29. package/build/index.js.map +1 -0
  30. package/eslint.config.js +3 -0
  31. package/expo-module.config.json +9 -0
  32. package/ios/Frameworks/LinkKit.xcframework/Info.plist +61 -0
  33. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit-Swift.h +327 -0
  34. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit.h +22 -0
  35. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
  36. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
  37. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +53681 -0
  38. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +756 -0
  39. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  40. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +756 -0
  41. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  42. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/module.modulemap +11 -0
  43. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
  44. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +205 -0
  45. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit-Swift.h +650 -0
  46. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit.h +22 -0
  47. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/LinkKit +0 -0
  48. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.abi.json +52299 -0
  49. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.private.swiftinterface +751 -0
  50. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftdoc +0 -0
  51. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftinterface +751 -0
  52. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftmodule +0 -0
  53. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.abi.json +52299 -0
  54. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.private.swiftinterface +751 -0
  55. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftdoc +0 -0
  56. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftinterface +751 -0
  57. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftmodule +0 -0
  58. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/module.modulemap +11 -0
  59. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/Info.plist +59 -0
  60. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/PrivacyInfo.xcprivacy +32 -0
  61. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/_CodeSignature/CodeResources +230 -0
  62. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit-Swift.h +650 -0
  63. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit.h +22 -0
  64. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
  65. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
  66. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +53681 -0
  67. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +756 -0
  68. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  69. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +756 -0
  70. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
  71. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +53681 -0
  72. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +756 -0
  73. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  74. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +756 -0
  75. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
  76. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/module.modulemap +11 -0
  77. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
  78. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +256 -0
  79. package/ios/ReactNativePlaidLinkSdk.podspec +31 -0
  80. package/ios/src/PlaidEmbeddedSearchView.swift +101 -0
  81. package/ios/src/RNPlaidLinkSdkVersion.swift +19 -0
  82. package/ios/src/ReactNativePlaidLinkSdkModule.swift +555 -0
  83. package/jest.config.js +21 -0
  84. package/jest.setup.js +7 -0
  85. package/package.json +32 -72
  86. package/scripts/check-package-entrypoints.js +146 -0
  87. package/scripts/extract-rn-enums.js +49 -0
  88. package/src/PlaidEmbeddedSearchView.tsx +35 -0
  89. package/src/ReactNativePlaidLinkSdk.types.ts +894 -0
  90. package/src/ReactNativePlaidLinkSdkModule.ts +31 -0
  91. package/src/index.ts +207 -22
  92. package/tsconfig.json +9 -0
  93. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  94. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  95. package/android/gradle.properties +0 -31
  96. package/android/gradlew +0 -174
  97. package/android/gradlew.bat +0 -89
  98. package/android/src/main/java/com/plaid/ActivityResultHandler.java +0 -7
  99. package/android/src/main/java/com/plaid/ActivityResultManager.java +0 -15
  100. package/android/src/main/java/com/plaid/GlobalFunctions.kt +0 -42
  101. package/android/src/main/java/com/plaid/PLKEmbeddedView.kt +0 -161
  102. package/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt +0 -50
  103. package/android/src/main/java/com/plaid/PlaidModule.kt +0 -291
  104. package/android/src/main/java/com/plaid/PlaidPackage.java +0 -117
  105. package/android/src/main/java/com/plaid/gson/PlaidJsonConverter.kt +0 -94
  106. package/android/src/main/java/com/plaid/gson/RNAccountAdapter.kt +0 -48
  107. package/android/src/main/java/com/plaid/gson/RNEventMetadataAdapter.kt +0 -49
  108. package/android/src/main/java/com/plaid/gson/RNLinkInstitutionAdapter.kt +0 -34
  109. package/android/src/main/res/layout/plk_embedded_view.xml +0 -5
  110. package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerDelegate.java +0 -35
  111. package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerInterface.java +0 -18
  112. package/android/src/paper/java/com/plaid/NativePlaidLinkModuleAndroidSpec.java +0 -64
  113. package/android/src/paper/java/com/plaid/NativePlaidLinkModuleiOSSpec.java +0 -59
  114. package/dist/build/EmbeddedLink/EmbeddedLinkView.d.ts +0 -2
  115. package/dist/build/EmbeddedLink/EmbeddedLinkView.js +0 -56
  116. package/dist/build/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
  117. package/dist/build/EmbeddedLink/EmbeddedLinkView.web.js +0 -2
  118. package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
  119. package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.js +0 -3
  120. package/dist/build/PlaidEmbeddedSearchView.d.ts +0 -2
  121. package/dist/build/PlaidEmbeddedSearchView.js +0 -25
  122. package/dist/build/PlaidLink.d.ts +0 -7
  123. package/dist/build/PlaidLink.js +0 -137
  124. package/dist/build/ReactNativePlaidLinkSdk.types.d.ts +0 -108
  125. package/dist/build/ReactNativePlaidLinkSdkModule.d.ts +0 -2
  126. package/dist/build/ReactNativePlaidLinkSdkView.d.ts +0 -2
  127. package/dist/build/ReactNativePlaidLinkSdkView.js +0 -7
  128. package/dist/build/Types.d.ts +0 -108
  129. package/dist/build/Types.js +0 -462
  130. package/dist/build/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -2
  131. package/dist/build/fabric/EmbeddedLinkViewNativeComponent.js +0 -3
  132. package/dist/build/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -2
  133. package/dist/build/fabric/NativePlaidLinkModuleAndroid.js +0 -5
  134. package/dist/build/fabric/NativePlaidLinkModuleiOS.d.ts +0 -2
  135. package/dist/build/fabric/NativePlaidLinkModuleiOS.js +0 -5
  136. package/dist/build/fabric/fabricUtils.d.ts +0 -1
  137. package/dist/build/fabric/fabricUtils.js +0 -2
  138. package/dist/build/index.d.ts +0 -14
  139. package/dist/build/index.js +0 -154
  140. package/dist/src/EmbeddedLink/EmbeddedLinkView.d.ts +0 -13
  141. package/dist/src/EmbeddedLink/EmbeddedLinkView.js +0 -55
  142. package/dist/src/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
  143. package/dist/src/EmbeddedLink/EmbeddedLinkView.web.js +0 -1
  144. package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
  145. package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.js +0 -2
  146. package/dist/src/PlaidLink.d.ts +0 -34
  147. package/dist/src/PlaidLink.js +0 -136
  148. package/dist/src/Types.js +0 -463
  149. package/dist/src/__tests__/Types.tests.d.ts +0 -1
  150. package/dist/src/__tests__/Types.tests.js +0 -14
  151. package/dist/src/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -15
  152. package/dist/src/fabric/EmbeddedLinkViewNativeComponent.js +0 -2
  153. package/dist/src/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -15
  154. package/dist/src/fabric/NativePlaidLinkModuleAndroid.js +0 -4
  155. package/dist/src/fabric/NativePlaidLinkModuleiOS.d.ts +0 -15
  156. package/dist/src/fabric/NativePlaidLinkModuleiOS.js +0 -4
  157. package/dist/src/fabric/fabricUtils.d.ts +0 -1
  158. package/dist/src/fabric/fabricUtils.js +0 -1
  159. package/dist/src/index.d.ts +0 -4
  160. package/dist/src/index.js +0 -5
  161. package/ios/PLKEmbeddedView.m +0 -7
  162. package/ios/PLKEmbeddedView.swift +0 -116
  163. package/ios/PLKEmbeddedViewComponentView.h +0 -28
  164. package/ios/PLKEmbeddedViewComponentView.mm +0 -91
  165. package/ios/PLKEmbeddedViewManager.swift +0 -14
  166. package/ios/PLKFabricHelpers.h +0 -116
  167. package/ios/RNLinksdk-Bridging-Header.h +0 -8
  168. package/ios/RNLinksdk.h +0 -19
  169. package/ios/RNLinksdk.mm +0 -732
  170. package/ios/RNPlaidHelper.h +0 -15
  171. package/ios/RNPlaidHelper.m +0 -33
  172. package/ios/react_native_plaid_link_sdk.h +0 -2
  173. package/react-native-plaid-link-sdk.podspec +0 -40
  174. package/src/EmbeddedLink/EmbeddedLinkView.tsx +0 -95
  175. package/src/EmbeddedLink/EmbeddedLinkView.web.tsx +0 -5
  176. package/src/EmbeddedLink/NativeEmbeddedLinkView.tsx +0 -3
  177. package/src/PlaidLink.tsx +0 -167
  178. package/src/Types.ts +0 -634
  179. package/src/__tests__/Types.tests.ts +0 -15
  180. package/src/fabric/EmbeddedLinkViewNativeComponent.ts +0 -24
  181. package/src/fabric/NativePlaidLinkModuleAndroid.ts +0 -32
  182. package/src/fabric/NativePlaidLinkModuleiOS.ts +0 -33
  183. package/src/fabric/fabricUtils.ts +0 -2
@@ -1,116 +0,0 @@
1
- import LinkKit
2
- import UIKit
3
-
4
- @objc public final class PLKEmbeddedView: UIView {
5
-
6
- // Properties exposed to React Native.
7
-
8
- @objc public var iOSPresentationStyle: String = "" {
9
- didSet {
10
- createNativeEmbeddedView()
11
- }
12
- }
13
-
14
- @objc public var token: String = "" {
15
- didSet {
16
- createNativeEmbeddedView()
17
- }
18
- }
19
-
20
- @objc public var onEmbeddedEvent: RCTDirectEventBlock?
21
-
22
- // MARK: Private
23
-
24
- private var linkHandler: Handler?
25
- private let embeddedEventName: String = "embeddedEventName"
26
-
27
- private func makeHandler() throws -> Handler {
28
- var config = LinkTokenConfiguration(
29
- token: token,
30
- onSuccess: { [weak self] success in
31
- guard let self = self else { return }
32
-
33
- let plkLinkSuccess = success.toObjC
34
- var dictionary = RNLinksdk.dictionary(from: plkLinkSuccess) ?? [:]
35
- dictionary[self.embeddedEventName] = "onSuccess"
36
- self.onEmbeddedEvent?(dictionary)
37
- }
38
- )
39
-
40
- config.onEvent = { [weak self] event in
41
- guard let self = self else { return }
42
-
43
- let plkLinkEvent = event.toObjC
44
- var dictionary = RNLinksdk.dictionary(from: plkLinkEvent) ?? [:]
45
- dictionary[self.embeddedEventName] = "onEvent"
46
- self.onEmbeddedEvent?(dictionary)
47
- }
48
-
49
- config.onExit = { [weak self] exit in
50
- guard let self = self else { return }
51
-
52
- let plkLinkExit = exit.toObjC
53
- var dictionary = RNLinksdk.dictionary(from: plkLinkExit) ?? [:]
54
- dictionary[self.embeddedEventName] = "onExit"
55
- self.onEmbeddedEvent?(dictionary)
56
- }
57
-
58
- let handlerCreationResult = Plaid.create(config)
59
-
60
- switch handlerCreationResult {
61
- case .failure(let error):
62
- throw (error)
63
- case .success(let handler):
64
- return handler
65
- }
66
- }
67
-
68
- private func makeEmbeddedView(rctViewController: UIViewController, handler: Handler) -> UIView {
69
- self.linkHandler = handler
70
-
71
- let presentationMethod: PresentationMethod
72
-
73
- if iOSPresentationStyle.uppercased() == "FULL_SCREEN" {
74
- presentationMethod = .custom({ viewController in
75
- viewController.modalPresentationStyle = .overFullScreen
76
- viewController.modalTransitionStyle = .coverVertical
77
-
78
- rctViewController.present(viewController, animated: true)
79
- })
80
- } else {
81
- presentationMethod = .viewController(rctViewController)
82
- }
83
-
84
- return handler.createEmbeddedView(presentUsing: presentationMethod)
85
- }
86
-
87
- private func createNativeEmbeddedView() {
88
- guard let rctViewController = RCTPresentedViewController() else { return }
89
- guard !token.isEmpty, !iOSPresentationStyle.isEmpty, linkHandler == nil else { return }
90
-
91
- do {
92
- let handler = try makeHandler()
93
- let embeddedView = makeEmbeddedView(rctViewController: rctViewController, handler: handler)
94
- setup(embeddedView: embeddedView)
95
- } catch {
96
- let dict: [String: Any] = [
97
- embeddedEventName: "onExit",
98
- "error": "\(error)",
99
- ]
100
-
101
- onEmbeddedEvent?(dict)
102
- }
103
- }
104
-
105
- private func setup(embeddedView: UIView) {
106
- embeddedView.translatesAutoresizingMaskIntoConstraints = false
107
- addSubview(embeddedView)
108
-
109
- NSLayoutConstraint.activate([
110
- embeddedView.topAnchor.constraint(equalTo: topAnchor),
111
- embeddedView.leadingAnchor.constraint(equalTo: leadingAnchor),
112
- embeddedView.trailingAnchor.constraint(equalTo: trailingAnchor),
113
- embeddedView.bottomAnchor.constraint(equalTo: bottomAnchor),
114
- ])
115
- }
116
- }
@@ -1,28 +0,0 @@
1
- #ifdef RCT_NEW_ARCH_ENABLED
2
-
3
- #import <UIKit/UIKit.h>
4
- #import <React/RCTUIManager.h>
5
- #import <React/RCTViewComponentView.h>
6
-
7
- NS_ASSUME_NONNULL_BEGIN
8
-
9
- /**
10
- * This file is required for compatibility with React Native's New Architecture (Fabric Renderer).
11
- *
12
- * - PLKEmbeddedViewComponentView extends `RCTViewComponentView` to define a custom native view
13
- * that works with the Fabric rendering system, improving UI performance and concurrency.
14
- * - The `#ifdef RCT_NEW_ARCH_ENABLED` directive ensures this code is only compiled when the
15
- * New Architecture is enabled, avoiding compatibility issues with older architectures.
16
- * - Custom native views like this are essential when integrating UIKit-based components into
17
- * React Native apps under the New Architecture.
18
- * - `RCTUIManager` handles the interaction between the native view and the React Native bridge,
19
- * enabling updates and commands from the JavaScript side.
20
- *
21
- * Ref - https://github.com/reactwg/react-native-new-architecture/blob/main/docs/backwards-compat-turbo-modules.md
22
- */
23
- @interface PLKEmbeddedViewComponentView : RCTViewComponentView
24
- @end
25
-
26
- NS_ASSUME_NONNULL_END
27
-
28
- #endif // RCT_NEW_ARCH_ENABLED
@@ -1,91 +0,0 @@
1
- #ifdef RCT_NEW_ARCH_ENABLED
2
-
3
- #import "PLKEmbeddedViewComponentView.h"
4
- #import "PLKFabricHelpers.h"
5
-
6
- #import <React/RCTBridge+Private.h>
7
- #import <React/RCTConversions.h>
8
- #import <React/RCTFabricComponentsPlugins.h>
9
-
10
- #import <react/renderer/components/rnplaidlink/ComponentDescriptors.h>
11
- #import <react/renderer/components/rnplaidlink/EventEmitters.h>
12
- #import <react/renderer/components/rnplaidlink/Props.h>
13
- #import <react/renderer/components/rnplaidlink/RCTComponentViewHelpers.h>
14
-
15
- using namespace facebook::react;
16
-
17
- @implementation PLKEmbeddedViewComponentView {
18
- PLKEmbeddedView *_view;
19
- }
20
-
21
- // Needed because of this: https://github.com/facebook/react-native/pull/37274
22
- + (void)load
23
- {
24
- [super load];
25
- }
26
-
27
- - (instancetype)initWithFrame:(CGRect)frame
28
- {
29
- if (self = [super initWithFrame:frame]) {
30
- static const auto defaultProps = std::make_shared<const PLKEmbeddedViewProps>();
31
- _props = defaultProps;
32
- [self prepareView];
33
- }
34
-
35
- return self;
36
- }
37
-
38
- - (void)prepareView
39
- {
40
- _view = [[PLKEmbeddedView alloc] init];
41
-
42
- __weak __typeof__(self) weakSelf = self;
43
-
44
- [_view setOnEmbeddedEvent:^(NSDictionary* event) {
45
- __typeof__(self) strongSelf = weakSelf;
46
-
47
- if (strongSelf != nullptr && strongSelf->_eventEmitter != nullptr) {
48
- std::dynamic_pointer_cast<const facebook::react::PLKEmbeddedViewEventEmitter>(strongSelf->_eventEmitter)->onEmbeddedEvent({
49
- .embeddedEventName = RCTStringFromNSString(event[@"embeddedEventName"]),
50
- .eventName = RCTStringFromNSString(event[@"eventName"]),
51
- .error = PLKConvertIdToFollyDynamic(event[@"error"]),
52
- .publicToken = RCTStringFromNSString(event[@"publicToken"]),
53
- .metadata = PLKConvertIdToFollyDynamic(event[@"metadata"]),
54
- });
55
- }
56
- }];
57
- self.contentView = _view;
58
- }
59
-
60
- #pragma mark - RCTComponentViewProtocol
61
-
62
- + (ComponentDescriptorProvider)componentDescriptorProvider
63
- {
64
- return concreteComponentDescriptorProvider<PLKEmbeddedViewComponentDescriptor>();
65
- }
66
-
67
-
68
- - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
69
- {
70
- const auto &newProps = static_cast<const PLKEmbeddedViewProps &>(*props);
71
- _view.token = RCTNSStringFromStringNilIfEmpty(newProps.token);
72
- _view.iOSPresentationStyle = RCTNSStringFromStringNilIfEmpty(newProps.token);
73
-
74
- [super updateProps:props oldProps:oldProps];
75
- }
76
-
77
- - (void)prepareForRecycle
78
- {
79
- [super prepareForRecycle];
80
- [self prepareView];
81
- }
82
-
83
-
84
- @end
85
-
86
- Class<RCTComponentViewProtocol> PLKEmbeddedViewCls(void)
87
- {
88
- return PLKEmbeddedViewComponentView.class;
89
- }
90
-
91
- #endif // RCT_NEW_ARCH_ENABLED
@@ -1,14 +0,0 @@
1
- import Foundation
2
-
3
- @objc(PLKEmbeddedViewManager)
4
- class PLKEmbeddedViewManager: RCTViewManager {
5
-
6
- override static func requiresMainQueueSetup() -> Bool {
7
- return true
8
- }
9
-
10
- override func view() -> UIView! {
11
- return PLKEmbeddedView()
12
- }
13
-
14
- }
@@ -1,116 +0,0 @@
1
- #import <React/RCTConversions.h>
2
- #import <folly/dynamic.h>
3
- #import <objc/runtime.h>
4
-
5
- // This block checks for the appropriate header file inclusion for the Plaid Link SDK.
6
- // It handles various project configurations such as the presence of `USE_FRAMEWORKS`
7
- // and whether the new architecture (`RCT_NEW_ARCH_ENABLED`) is enabled.
8
-
9
- #if __has_include(<rnplaidlink/react_native_plaid_link_sdk-Swift.h>)
10
- // If the header file is available under the rnplaidlink module, include it.
11
- // This is typically the case when the module is structured with this specific header path.
12
- #import <rnplaidlink/react_native_plaid_link_sdk-Swift.h>
13
-
14
- #else
15
- // If the header is not found at the above path, check for other configurations.
16
- #if defined(RCT_NEW_ARCH_ENABLED) && defined(USE_FRAMEWORKS)
17
- // Include the header for projects with the new React Native architecture and `use_frameworks!` enabled.
18
- // This path supports modular builds with frameworks.
19
- #import <react_native_plaid_link_sdk/react_native_plaid_link_sdk-Swift.h>
20
-
21
- #else
22
- #if __has_include(<react_native_plaid_link_sdk/react_native_plaid_link_sdk-Swift.h>)
23
- // Include the header for projects using frameworks (`use_frameworks!` in the Podfile).
24
- // Frameworks are being used (static or dynamic).
25
- #import <react_native_plaid_link_sdk/react_native_plaid_link_sdk-Swift.h>
26
-
27
- #else
28
- // Default to including the header directly for non-framework builds.
29
- #import <react_native_plaid_link_sdk-Swift.h>
30
- #endif
31
- #endif
32
- #endif
33
-
34
- /*
35
-
36
- ### Notes for Developers: If you experience a compiler error above!
37
-
38
- 1. If you're using frameworks - Ensure your pods are installed with the `USE_FRAMEWORKS=1` environment variable:
39
- USE_FRAMEWORKS=1 bundle exec pod install
40
-
41
- 2. Verify that your `Podfile` includes either:
42
- use_frameworks! :linkage => :dynamic
43
- or
44
- use_frameworks! :linkage => :static
45
-
46
- 3. Refer to these GitHub issues for more details:
47
- - https://github.com/plaid/react-native-plaid-link-sdk/issues/713
48
- - https://github.com/plaid/react-native-plaid-link-sdk/issues/732
49
- - https://github.com/plaid/react-native-plaid-link-sdk/issues/747
50
-
51
- ### Troubleshooting:
52
- - If `USE_FRAMEWORKS` is not working, ensure it is correctly passed as a preprocessor macro in your Xcode build settings.
53
- - For new architecture projects, confirm `RCT_NEW_ARCH_ENABLED` is properly set in your environment.
54
- */
55
-
56
-
57
- // copied from RCTFollyConvert
58
- folly::dynamic PLKConvertIdToFollyDynamic(id json)
59
- {
60
- if (json == nil || json == (id)kCFNull) {
61
- return nullptr;
62
- } else if ([json isKindOfClass:[NSNumber class]]) {
63
- const char *objCType = [json objCType];
64
- switch (objCType[0]) {
65
- // This is a c++ bool or C99 _Bool. On some platforms, BOOL is a bool.
66
- case _C_BOOL:
67
- return (bool)[json boolValue];
68
- case _C_CHR:
69
- // On some platforms, objc BOOL is a signed char, but it
70
- // might also be a small number. Use the same hack JSC uses
71
- // to distinguish them:
72
- // https://phabricator.intern.facebook.com/diffusion/FBS/browse/master/fbobjc/xplat/third-party/jsc/safari-600-1-4-17/JavaScriptCore/API/JSValue.mm;b8ee03916489f8b12143cd5c0bca546da5014fc9$901
73
- if ([json isKindOfClass:[@YES class]]) {
74
- return (bool)[json boolValue];
75
- } else {
76
- return [json longLongValue];
77
- }
78
- case _C_UCHR:
79
- case _C_SHT:
80
- case _C_USHT:
81
- case _C_INT:
82
- case _C_UINT:
83
- case _C_LNG:
84
- case _C_ULNG:
85
- case _C_LNG_LNG:
86
- case _C_ULNG_LNG:
87
- return [json longLongValue];
88
-
89
- case _C_FLT:
90
- case _C_DBL:
91
- return [json doubleValue];
92
-
93
- // default:
94
- // fall through
95
- }
96
- } else if ([json isKindOfClass:[NSString class]]) {
97
- NSData *data = [json dataUsingEncoding:NSUTF8StringEncoding];
98
- return std::string(reinterpret_cast<const char *>(data.bytes), data.length);
99
- } else if ([json isKindOfClass:[NSArray class]]) {
100
- folly::dynamic array = folly::dynamic::array;
101
- for (id element in json) {
102
- array.push_back(PLKConvertIdToFollyDynamic(element));
103
- }
104
- return array;
105
- } else if ([json isKindOfClass:[NSDictionary class]]) {
106
- __block folly::dynamic object = folly::dynamic::object();
107
-
108
- [json enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, __unused BOOL *stop) {
109
- object.insert(PLKConvertIdToFollyDynamic(key), PLKConvertIdToFollyDynamic(value));
110
- }];
111
-
112
- return object;
113
- }
114
-
115
- return nil;
116
- }
@@ -1,8 +0,0 @@
1
- #import <React/RCTBundleURLProvider.h>
2
- #import <React/RCTRootView.h>
3
- #import <React/RCTComponent.h>
4
- #import <React/RCTBridgeModule.h>
5
- #import <React/RCTViewManager.h>
6
- #import <React/RCTDevLoadingView.h>
7
-
8
- #import "RNLinksdk.h"
package/ios/RNLinksdk.h DELETED
@@ -1,19 +0,0 @@
1
- #ifdef RCT_NEW_ARCH_ENABLED
2
- #import <rnplaidlink/rnplaidlink.h>
3
- #endif
4
- #import <React/RCTBridge.h>
5
- #import "RCTEventEmitter.h"
6
-
7
- #import <LinkKit/LinkKit.h>
8
-
9
- @interface RNLinksdk : RCTEventEmitter
10
- #ifdef RCT_NEW_ARCH_ENABLED
11
- <NativePlaidLinkModuleiOSSpec>
12
- #else
13
- <RCTBridgeModule>
14
- #endif
15
-
16
- + (NSDictionary *)dictionaryFromSuccess:(PLKLinkSuccess *)success;
17
- + (NSDictionary *)dictionaryFromEvent:(PLKLinkEvent *)event;
18
- + (NSDictionary *)dictionaryFromExit:(PLKLinkExit *)exit;
19
- @end