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.
- package/.eslintrc.js +5 -0
- package/.gitattributes +3 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +1458 -0
- package/README.md +17 -277
- package/V13_MIGRATION_GUIDE.md +470 -0
- package/android/build.gradle +30 -98
- package/android/src/main/AndroidManifest.xml +1 -8
- package/android/src/main/java/expo/modules/plaidlinksdk/PlaidEmbeddedResultDispatcher.kt +19 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/PlaidResultMappers.kt +217 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt +5 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkModule.kt +183 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkView.kt +69 -0
- package/build/PlaidEmbeddedSearchView.d.ts +12 -0
- package/build/PlaidEmbeddedSearchView.d.ts.map +1 -0
- package/build/PlaidEmbeddedSearchView.js +8 -0
- package/build/PlaidEmbeddedSearchView.js.map +1 -0
- package/{dist/src/Types.d.ts → build/ReactNativePlaidLinkSdk.types.d.ts} +78 -47
- package/build/ReactNativePlaidLinkSdk.types.d.ts.map +1 -0
- package/{dist/build → build}/ReactNativePlaidLinkSdk.types.js +82 -71
- package/build/ReactNativePlaidLinkSdk.types.js.map +1 -0
- package/build/ReactNativePlaidLinkSdkModule.d.ts +16 -0
- package/build/ReactNativePlaidLinkSdkModule.d.ts.map +1 -0
- package/{dist/build → build}/ReactNativePlaidLinkSdkModule.js +1 -1
- package/build/ReactNativePlaidLinkSdkModule.js.map +1 -0
- package/build/index.d.ts +13 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +134 -0
- package/build/index.js.map +1 -0
- package/eslint.config.js +3 -0
- package/expo-module.config.json +9 -0
- package/ios/Frameworks/LinkKit.xcframework/Info.plist +61 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit-Swift.h +327 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +205 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit-Swift.h +650 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/LinkKit +0 -0
- 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
- 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
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftmodule +0 -0
- 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
- 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
- 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
- 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
- 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
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/Info.plist +59 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/_CodeSignature/CodeResources +230 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit-Swift.h +650 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +256 -0
- package/ios/ReactNativePlaidLinkSdk.podspec +31 -0
- package/ios/src/PlaidEmbeddedSearchView.swift +101 -0
- package/ios/src/RNPlaidLinkSdkVersion.swift +19 -0
- package/ios/src/ReactNativePlaidLinkSdkModule.swift +555 -0
- package/jest.config.js +21 -0
- package/jest.setup.js +7 -0
- package/package.json +32 -72
- package/scripts/check-package-entrypoints.js +146 -0
- package/scripts/extract-rn-enums.js +49 -0
- package/src/PlaidEmbeddedSearchView.tsx +35 -0
- package/src/ReactNativePlaidLinkSdk.types.ts +894 -0
- package/src/ReactNativePlaidLinkSdkModule.ts +31 -0
- package/src/index.ts +207 -22
- package/tsconfig.json +9 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradle.properties +0 -31
- package/android/gradlew +0 -174
- package/android/gradlew.bat +0 -89
- package/android/src/main/java/com/plaid/ActivityResultHandler.java +0 -7
- package/android/src/main/java/com/plaid/ActivityResultManager.java +0 -15
- package/android/src/main/java/com/plaid/GlobalFunctions.kt +0 -42
- package/android/src/main/java/com/plaid/PLKEmbeddedView.kt +0 -161
- package/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt +0 -50
- package/android/src/main/java/com/plaid/PlaidModule.kt +0 -291
- package/android/src/main/java/com/plaid/PlaidPackage.java +0 -117
- package/android/src/main/java/com/plaid/gson/PlaidJsonConverter.kt +0 -94
- package/android/src/main/java/com/plaid/gson/RNAccountAdapter.kt +0 -48
- package/android/src/main/java/com/plaid/gson/RNEventMetadataAdapter.kt +0 -49
- package/android/src/main/java/com/plaid/gson/RNLinkInstitutionAdapter.kt +0 -34
- package/android/src/main/res/layout/plk_embedded_view.xml +0 -5
- package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerDelegate.java +0 -35
- package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerInterface.java +0 -18
- package/android/src/paper/java/com/plaid/NativePlaidLinkModuleAndroidSpec.java +0 -64
- package/android/src/paper/java/com/plaid/NativePlaidLinkModuleiOSSpec.java +0 -59
- package/dist/build/EmbeddedLink/EmbeddedLinkView.d.ts +0 -2
- package/dist/build/EmbeddedLink/EmbeddedLinkView.js +0 -56
- package/dist/build/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
- package/dist/build/EmbeddedLink/EmbeddedLinkView.web.js +0 -2
- package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
- package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.js +0 -3
- package/dist/build/PlaidEmbeddedSearchView.d.ts +0 -2
- package/dist/build/PlaidEmbeddedSearchView.js +0 -25
- package/dist/build/PlaidLink.d.ts +0 -7
- package/dist/build/PlaidLink.js +0 -137
- package/dist/build/ReactNativePlaidLinkSdk.types.d.ts +0 -108
- package/dist/build/ReactNativePlaidLinkSdkModule.d.ts +0 -2
- package/dist/build/ReactNativePlaidLinkSdkView.d.ts +0 -2
- package/dist/build/ReactNativePlaidLinkSdkView.js +0 -7
- package/dist/build/Types.d.ts +0 -108
- package/dist/build/Types.js +0 -462
- package/dist/build/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -2
- package/dist/build/fabric/EmbeddedLinkViewNativeComponent.js +0 -3
- package/dist/build/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -2
- package/dist/build/fabric/NativePlaidLinkModuleAndroid.js +0 -5
- package/dist/build/fabric/NativePlaidLinkModuleiOS.d.ts +0 -2
- package/dist/build/fabric/NativePlaidLinkModuleiOS.js +0 -5
- package/dist/build/fabric/fabricUtils.d.ts +0 -1
- package/dist/build/fabric/fabricUtils.js +0 -2
- package/dist/build/index.d.ts +0 -14
- package/dist/build/index.js +0 -154
- package/dist/src/EmbeddedLink/EmbeddedLinkView.d.ts +0 -13
- package/dist/src/EmbeddedLink/EmbeddedLinkView.js +0 -55
- package/dist/src/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
- package/dist/src/EmbeddedLink/EmbeddedLinkView.web.js +0 -1
- package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
- package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.js +0 -2
- package/dist/src/PlaidLink.d.ts +0 -34
- package/dist/src/PlaidLink.js +0 -136
- package/dist/src/Types.js +0 -463
- package/dist/src/__tests__/Types.tests.d.ts +0 -1
- package/dist/src/__tests__/Types.tests.js +0 -14
- package/dist/src/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -15
- package/dist/src/fabric/EmbeddedLinkViewNativeComponent.js +0 -2
- package/dist/src/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -15
- package/dist/src/fabric/NativePlaidLinkModuleAndroid.js +0 -4
- package/dist/src/fabric/NativePlaidLinkModuleiOS.d.ts +0 -15
- package/dist/src/fabric/NativePlaidLinkModuleiOS.js +0 -4
- package/dist/src/fabric/fabricUtils.d.ts +0 -1
- package/dist/src/fabric/fabricUtils.js +0 -1
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -5
- package/ios/PLKEmbeddedView.m +0 -7
- package/ios/PLKEmbeddedView.swift +0 -116
- package/ios/PLKEmbeddedViewComponentView.h +0 -28
- package/ios/PLKEmbeddedViewComponentView.mm +0 -91
- package/ios/PLKEmbeddedViewManager.swift +0 -14
- package/ios/PLKFabricHelpers.h +0 -116
- package/ios/RNLinksdk-Bridging-Header.h +0 -8
- package/ios/RNLinksdk.h +0 -19
- package/ios/RNLinksdk.mm +0 -732
- package/ios/RNPlaidHelper.h +0 -15
- package/ios/RNPlaidHelper.m +0 -33
- package/ios/react_native_plaid_link_sdk.h +0 -2
- package/react-native-plaid-link-sdk.podspec +0 -40
- package/src/EmbeddedLink/EmbeddedLinkView.tsx +0 -95
- package/src/EmbeddedLink/EmbeddedLinkView.web.tsx +0 -5
- package/src/EmbeddedLink/NativeEmbeddedLinkView.tsx +0 -3
- package/src/PlaidLink.tsx +0 -167
- package/src/Types.ts +0 -634
- package/src/__tests__/Types.tests.ts +0 -15
- package/src/fabric/EmbeddedLinkViewNativeComponent.ts +0 -24
- package/src/fabric/NativePlaidLinkModuleAndroid.ts +0 -32
- package/src/fabric/NativePlaidLinkModuleiOS.ts +0 -33
- 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
|
-
}
|
package/ios/PLKFabricHelpers.h
DELETED
|
@@ -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
|
-
}
|
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
|