react-native-plaid-link-sdk 11.5.2 → 11.7.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/README.md +89 -64
- package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4.2/checksums/sha1-checksums.bin +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/plaid/PlaidModule.kt +49 -0
- package/dist/PlaidLink.d.ts +10 -2
- package/dist/PlaidLink.js +68 -7
- package/dist/Types.d.ts +8 -0
- package/dist/Types.js +2 -0
- package/ios/RNLinksdk.m +5 -1
- package/ios/RNLinksdk.xcworkspace/xcuserdata/dtroupe.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
- package/react-native-plaid-link-sdk.podspec +1 -1
package/README.md
CHANGED
|
@@ -54,36 +54,82 @@ AutoLinking should handle all of the Android setup.
|
|
|
54
54
|
|
|
55
55
|
- To initialize `PlaidLink`, you will need to first create a `link_token` at [/link/token/create](https://plaid.com/docs/#create-link-token). Check out our [QuickStart guide](https://plaid.com/docs/quickstart/#introduction) for additional API information.
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
#### Version >= 11.6.0
|
|
58
|
+
|
|
59
|
+
Starting from version `11.6.0`, we introduced the ability to preload part of the Link experience. You can initiate the preloading process by invoking the `create` function.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
function createLinkTokenConfiguration(
|
|
63
|
+
token: string,
|
|
64
|
+
noLoadingState: boolean = false,
|
|
65
|
+
): LinkTokenConfiguration {
|
|
66
|
+
return {
|
|
67
|
+
token: token,
|
|
68
|
+
// Hides native activity indicator if true.
|
|
69
|
+
noLoadingState: noLoadingState,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
58
72
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
const tokenConfiguration = createLinkTokenConfiguration("#GENERATED_LINK_TOKEN#");
|
|
74
|
+
create(tokenConfiguration);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
After calling `create`, you can subsequently invoke the `open` function. Note that maximizing the delay between these two calls will reduce latency for your users by allowing Link more time to load.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
function createLinkOpenProps(): LinkOpenProps {
|
|
81
|
+
return {
|
|
82
|
+
onSuccess: (success: LinkSuccess) => {
|
|
83
|
+
// User was able to successfully link their account.
|
|
84
|
+
console.log('Success: ', success);
|
|
85
|
+
},
|
|
86
|
+
onExit: (linkExit: LinkExit) => {
|
|
87
|
+
// User exited Link session. There may or may not be an error depending on what occured.
|
|
88
|
+
console.log('Exit: ', linkExit);
|
|
89
|
+
dismissLink();
|
|
90
|
+
},
|
|
91
|
+
// MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
|
|
92
|
+
iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
|
|
93
|
+
logLevel: LinkLogLevel.ERROR,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const openProps = createLinkOpenProps();
|
|
98
|
+
open(openProps);
|
|
84
99
|
```
|
|
85
100
|
|
|
86
|
-
|
|
101
|
+
#### Version < 11.6.0
|
|
102
|
+
|
|
103
|
+
In versions prior to `11.6.0`, you can open a link by calling the `openLink` function.
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
// Create PlaidLinkProps from the provided token string.
|
|
107
|
+
function makeLinkTokenProps(token: string): PlaidLinkProps {
|
|
108
|
+
return {
|
|
109
|
+
tokenConfig: {
|
|
110
|
+
token: token,
|
|
111
|
+
logLevel: LinkLogLevel.ERROR,
|
|
112
|
+
// Hides native activity indicator if true.
|
|
113
|
+
noLoadingState: false,
|
|
114
|
+
},
|
|
115
|
+
onSuccess: (success: LinkSuccess) => {
|
|
116
|
+
// User was able to successfully link their account.
|
|
117
|
+
console.log('Success: ', success);
|
|
118
|
+
success.metadata.accounts.forEach(it => console.log('accounts', it));
|
|
119
|
+
},
|
|
120
|
+
onExit: (linkExit: LinkExit) => {
|
|
121
|
+
// User exited Link session. There may or may not be an error depending on what occured.
|
|
122
|
+
console.log('Exit: ', linkExit);
|
|
123
|
+
dismissLink();
|
|
124
|
+
},
|
|
125
|
+
// MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
|
|
126
|
+
iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const linkTokenProps = makeLinkTokenProps("#GENERATED_LINK_TOKEN#");
|
|
131
|
+
openLink(linkTokenProps);
|
|
132
|
+
```
|
|
87
133
|
|
|
88
134
|
#### OAuth requirements
|
|
89
135
|
|
|
@@ -113,30 +159,7 @@ For iOS OAuth to work, specific requirements must be met.
|
|
|
113
159
|
|
|
114
160
|
#### To receive onEvent callbacks:
|
|
115
161
|
|
|
116
|
-
The React Native Plaid module emits `onEvent` events throughout the account linking process — see [details here](https://plaid.com/docs/link/react-native/#onevent). To receive these events in your React Native app,
|
|
117
|
-
|
|
118
|
-
```javascript
|
|
119
|
-
import React from 'react';
|
|
120
|
-
import { Text, NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
121
|
-
|
|
122
|
-
class PlaidEventContainer extends React.Component {
|
|
123
|
-
|
|
124
|
-
componentDidMount() {
|
|
125
|
-
const emitter = new NativeEventEmitter(Platform.OS === 'ios' ? NativeModules.RNLinksdk : NativeModules.PlaidAndroid);
|
|
126
|
-
this._listener = emitter.addListener('onEvent', (e) => console.log(e));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
componentWillUnmount() {
|
|
130
|
-
if (this._listener) {
|
|
131
|
-
this._listener.remove();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
...
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
You can also use the `usePlaidEmitter` hook in react functional components:
|
|
162
|
+
The React Native Plaid module emits `onEvent` events throughout the account linking process — see [details here](https://plaid.com/docs/link/react-native/#onevent). To receive these events in your React Native app, use the `usePlaidEmitter` hook in react functional components:
|
|
140
163
|
|
|
141
164
|
```javascript
|
|
142
165
|
usePlaidEmitter((event: LinkEvent) => {
|
|
@@ -156,17 +179,19 @@ While these older versions are expected to continue to work without disruption,
|
|
|
156
179
|
|
|
157
180
|
| Plaid SDK Version | Min React Native Version | Android SDK | Android Min Version | Android Compile Version| iOS SDK | iOS Min Version | Status |
|
|
158
181
|
|-------------------|--------------------------|-------------|---------------------|------------------------|---------|-----------------|-------------------------------|
|
|
159
|
-
| 11.
|
|
160
|
-
| 11.
|
|
161
|
-
| 11.5.
|
|
162
|
-
| 11.
|
|
163
|
-
| 11.
|
|
164
|
-
|
|
|
165
|
-
| 11.
|
|
166
|
-
| 11.0
|
|
167
|
-
| 11.0
|
|
168
|
-
| 11.0.
|
|
169
|
-
| 11.0.
|
|
182
|
+
| 11.7.0 | * | [4.3.0+] | 21 | 34 | >=5.4.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
183
|
+
| 11.6.0 | * | [4.2.0+] | 21 | 34 | >=5.3.1 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
184
|
+
| 11.5.2 | * | [4.1.1+] | 21 | 34 | >=5.2.1 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
185
|
+
| 11.5.1 | * | [4.1.1+] | 21 | 34 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
186
|
+
| 11.5.0 | * | [4.1.1+] | 21 | 34 | >=5.2.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
187
|
+
| 11.4.0 | * | [4.1.1+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
188
|
+
| 11.3.0 | * | [4.0.0+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
189
|
+
| ~11.2.0~ | * | [4.1.0+] | 21 | 34 | >=5.1.0 | 14.0 | **Deprecated** |
|
|
190
|
+
| 11.1.0 | * | [4.0.0+] | 21 | 34 | >=5.1.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
191
|
+
| 11.0.3 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
192
|
+
| 11.0.2 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
193
|
+
| 11.0.1 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
194
|
+
| 11.0.0 | * | [4.0.0+] | 21 | 34 | >=5.0.0 | 14.0 | Active, supports Xcode 15.0.1 |
|
|
170
195
|
| 10.13.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.2 | 11.0 | Active, supports Xcode 14 |
|
|
171
196
|
| 10.12.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
|
|
172
197
|
| 10.11.0 | >= 0.66.0 | [3.14.1+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
|
|
@@ -179,8 +204,8 @@ While these older versions are expected to continue to work without disruption,
|
|
|
179
204
|
| 10.6.3 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Active, supports Xcode 14 |
|
|
180
205
|
| 10.6.2 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Deprecated, supports Xcode 14 |
|
|
181
206
|
| 10.6.0 | >= 0.66.0 | [3.14.0+] | 21 | 33 | >=4.6.4 | 11.0 | Deprecated, supports Xcode 14 |
|
|
182
|
-
| 10.5.0 | >= 0.66.0 | [3.
|
|
183
|
-
| 10.4.0 | >= 0.66.0 | [3.
|
|
207
|
+
| 10.5.0 | >= 0.66.0 | [3.13.2+] | 21 | 33 | >=4.5.1 | 11.0 | Deprecated, supports Xcode 14 |
|
|
208
|
+
| 10.4.0 | >= 0.66.0 | [3.13.2+] | 21 | 33 | >=4.4.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
184
209
|
| 10.3.0 | >= 0.66.0 | [3.12.1+] | 21 | 33 | >=4.3.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
185
210
|
| 10.2.0 | >= 0.66.0 | [3.12.0+] | 21 | 33 | >=4.3.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
186
211
|
| 10.1.0 | >= 0.66.0 | [3.11.0+] | 21 | 33 | >=4.2.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -70,7 +70,7 @@ repositories {
|
|
|
70
70
|
|
|
71
71
|
dependencies {
|
|
72
72
|
implementation "com.facebook.react:react-native:+"
|
|
73
|
-
implementation "com.plaid.link:sdk-core:4.
|
|
73
|
+
implementation "com.plaid.link:sdk-core:4.3.0"
|
|
74
74
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
75
75
|
implementation "com.jakewharton.rxrelay2:rxrelay:2.1.1"
|
|
76
76
|
}
|
|
@@ -14,6 +14,7 @@ import com.facebook.react.module.annotations.ReactModule
|
|
|
14
14
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
15
15
|
import com.plaid.gson.PlaidJsonConverter
|
|
16
16
|
import com.plaid.link.Plaid
|
|
17
|
+
import com.plaid.link.PlaidHandler
|
|
17
18
|
import com.plaid.link.configuration.LinkLogLevel
|
|
18
19
|
import com.plaid.link.configuration.LinkTokenConfiguration
|
|
19
20
|
import com.plaid.link.event.LinkEvent
|
|
@@ -35,6 +36,8 @@ class PlaidModule internal constructor(reactContext: ReactApplicationContext) :
|
|
|
35
36
|
private var onSuccessCallback: Callback? = null
|
|
36
37
|
private var onExitCallback: Callback? = null
|
|
37
38
|
|
|
39
|
+
private var plaidHandler: PlaidHandler? = null
|
|
40
|
+
|
|
38
41
|
companion object {
|
|
39
42
|
private const val LINK_TOKEN_PREFIX = "link"
|
|
40
43
|
|
|
@@ -76,6 +79,52 @@ class PlaidModule internal constructor(reactContext: ReactApplicationContext) :
|
|
|
76
79
|
return builder.build()
|
|
77
80
|
}
|
|
78
81
|
|
|
82
|
+
@ReactMethod
|
|
83
|
+
fun create(
|
|
84
|
+
token: String,
|
|
85
|
+
noLoadingState: Boolean,
|
|
86
|
+
logLevel: String,
|
|
87
|
+
) {
|
|
88
|
+
val tokenConfiguration = getLinkTokenConfiguration(token, noLoadingState, getLogLevel(logLevel))
|
|
89
|
+
if (tokenConfiguration == null) {
|
|
90
|
+
throw LinkException("Unable to open link, please check that your configuration is valid")
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Set the event listener here instead of in open for Layer use cases.
|
|
94
|
+
try {
|
|
95
|
+
Plaid.setLinkEventListener { linkEvent: LinkEvent ->
|
|
96
|
+
var json = jsonConverter.convert(linkEvent)
|
|
97
|
+
val eventMap = convertJsonToMap(JSONObject(json))
|
|
98
|
+
reactApplicationContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
99
|
+
.emit("onEvent", eventMap)
|
|
100
|
+
}
|
|
101
|
+
} catch (ex: JSONException) {
|
|
102
|
+
Log.e("PlaidModule", ex.toString())
|
|
103
|
+
throw ex
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Create Plaid handler.
|
|
107
|
+
this.plaidHandler = Plaid.create(
|
|
108
|
+
reactApplicationContext.getApplicationContext() as Application,
|
|
109
|
+
tokenConfiguration
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@ReactMethod
|
|
114
|
+
fun open(onSuccessCallback: Callback, onExitCallback: Callback) {
|
|
115
|
+
val activity = currentActivity ?: throw IllegalStateException("Current activity is null")
|
|
116
|
+
|
|
117
|
+
plaidHandler?.let { handler ->
|
|
118
|
+
// Work with nonNullValue here
|
|
119
|
+
this.onSuccessCallback = onSuccessCallback
|
|
120
|
+
this.onExitCallback = onExitCallback
|
|
121
|
+
handler.open(activity)
|
|
122
|
+
} ?: run {
|
|
123
|
+
// Handler is nil.
|
|
124
|
+
throw LinkException("Create must be called before open.")
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
79
128
|
@ReactMethod
|
|
80
129
|
@Suppress("unused")
|
|
81
130
|
fun startLinkActivityForResult(
|
package/dist/PlaidLink.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { LinkEventListener, PlaidLinkComponentProps, PlaidLinkProps } from './Types';
|
|
2
|
+
import { LinkEventListener, LinkOpenProps, LinkTokenConfiguration, PlaidLinkComponentProps, PlaidLinkProps } from './Types';
|
|
3
3
|
/**
|
|
4
4
|
* A hook that registers a listener on the Plaid emitter for the 'onEvent' type.
|
|
5
5
|
* The listener is cleaned up when this view is unmounted
|
|
@@ -7,6 +7,14 @@ import { LinkEventListener, PlaidLinkComponentProps, PlaidLinkProps } from './Ty
|
|
|
7
7
|
* @param LinkEventListener the listener to call
|
|
8
8
|
*/
|
|
9
9
|
export declare const usePlaidEmitter: (LinkEventListener: LinkEventListener) => void;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const create: (props: LinkTokenConfiguration) => void;
|
|
11
|
+
export declare const open: (props: LinkOpenProps) => Promise<void>;
|
|
11
12
|
export declare const dismissLink: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated This component is deprecated. Create your own component and use the create & open methods.
|
|
15
|
+
*/
|
|
12
16
|
export declare const PlaidLink: (props: PlaidLinkComponentProps) => React.JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated This method is deprecated. For faster loading use the create & open methods.
|
|
19
|
+
*/
|
|
20
|
+
export declare const openLink: (props: PlaidLinkProps) => Promise<void>;
|
package/dist/PlaidLink.js
CHANGED
|
@@ -28,12 +28,20 @@ export const usePlaidEmitter = (LinkEventListener) => {
|
|
|
28
28
|
};
|
|
29
29
|
}, []);
|
|
30
30
|
};
|
|
31
|
-
export const
|
|
31
|
+
export const create = (props) => {
|
|
32
32
|
var _a, _b;
|
|
33
|
-
let
|
|
34
|
-
let noLoadingState = (_a =
|
|
33
|
+
let token = props.token;
|
|
34
|
+
let noLoadingState = (_a = props.noLoadingState) !== null && _a !== void 0 ? _a : false;
|
|
35
35
|
if (Platform.OS === 'android') {
|
|
36
|
-
NativeModules.PlaidAndroid.
|
|
36
|
+
NativeModules.PlaidAndroid.create(token, noLoadingState, (_b = props.logLevel) !== null && _b !== void 0 ? _b : LinkLogLevel.ERROR);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
NativeModules.RNLinksdk.create(token, noLoadingState);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export const open = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
if (Platform.OS === 'android') {
|
|
44
|
+
NativeModules.PlaidAndroid.open((result) => {
|
|
37
45
|
if (props.onSuccess != null) {
|
|
38
46
|
props.onSuccess(result);
|
|
39
47
|
}
|
|
@@ -48,7 +56,6 @@ export const openLink = (props) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
48
56
|
});
|
|
49
57
|
}
|
|
50
58
|
else {
|
|
51
|
-
NativeModules.RNLinksdk.create(config.token, noLoadingState);
|
|
52
59
|
let presentFullScreen = props.iOSPresentationStyle == LinkIOSPresentationStyle.FULL_SCREEN;
|
|
53
60
|
NativeModules.RNLinksdk.open(presentFullScreen, (result) => {
|
|
54
61
|
if (props.onSuccess != null) {
|
|
@@ -73,11 +80,65 @@ export const dismissLink = () => {
|
|
|
73
80
|
NativeModules.RNLinksdk.dismiss();
|
|
74
81
|
}
|
|
75
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated This component is deprecated. Create your own component and use the create & open methods.
|
|
85
|
+
*/
|
|
76
86
|
export const PlaidLink = (props) => {
|
|
77
87
|
function onPress() {
|
|
78
88
|
var _a;
|
|
89
|
+
// Create a handler.
|
|
90
|
+
create(props.tokenConfig);
|
|
79
91
|
(_a = props.onPress) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
80
|
-
|
|
92
|
+
const openProps = {
|
|
93
|
+
onSuccess: props.onSuccess,
|
|
94
|
+
onExit: props.onExit,
|
|
95
|
+
iOSPresentationStyle: props.iOSPresentationStyle,
|
|
96
|
+
logLevel: props.logLevel,
|
|
97
|
+
};
|
|
98
|
+
open(openProps);
|
|
81
99
|
}
|
|
82
|
-
return <TouchableOpacity onPress={onPress}>{props.children}</TouchableOpacity
|
|
100
|
+
return (<TouchableOpacity onPress={onPress}>{props.children}</TouchableOpacity>);
|
|
83
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated This method is deprecated. For faster loading use the create & open methods.
|
|
104
|
+
*/
|
|
105
|
+
export const openLink = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
let config = props.tokenConfig;
|
|
108
|
+
let noLoadingState = (_a = config.noLoadingState) !== null && _a !== void 0 ? _a : false;
|
|
109
|
+
if (Platform.OS === 'android') {
|
|
110
|
+
NativeModules.PlaidAndroid.startLinkActivityForResult(config.token, noLoadingState, (_b = config.logLevel) !== null && _b !== void 0 ? _b : LinkLogLevel.ERROR, (result) => {
|
|
111
|
+
if (props.onSuccess != null) {
|
|
112
|
+
props.onSuccess(result);
|
|
113
|
+
}
|
|
114
|
+
}, (result) => {
|
|
115
|
+
if (props.onExit != null) {
|
|
116
|
+
if (result.error != null && result.error.displayMessage != null) {
|
|
117
|
+
//TODO(RNSDK-118): Remove errorDisplayMessage field in next major update.
|
|
118
|
+
result.error.errorDisplayMessage = result.error.displayMessage;
|
|
119
|
+
}
|
|
120
|
+
props.onExit(result);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
NativeModules.RNLinksdk.create(config.token, noLoadingState);
|
|
126
|
+
let presentFullScreen = props.iOSPresentationStyle == LinkIOSPresentationStyle.FULL_SCREEN;
|
|
127
|
+
NativeModules.RNLinksdk.open(presentFullScreen, (result) => {
|
|
128
|
+
if (props.onSuccess != null) {
|
|
129
|
+
props.onSuccess(result);
|
|
130
|
+
}
|
|
131
|
+
}, (error, result) => {
|
|
132
|
+
if (props.onExit != null) {
|
|
133
|
+
if (error) {
|
|
134
|
+
var data = result || {};
|
|
135
|
+
data.error = error;
|
|
136
|
+
props.onExit(data);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
props.onExit(result);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
package/dist/Types.d.ts
CHANGED
|
@@ -409,6 +409,8 @@ export declare enum LinkEventName {
|
|
|
409
409
|
OPEN = "OPEN",
|
|
410
410
|
OPEN_MY_PLAID = "OPEN_MY_PLAID",
|
|
411
411
|
OPEN_OAUTH = "OPEN_OAUTH",
|
|
412
|
+
PROFILE_ELIGIBILITY_CHECK_READY = "PROFILE_ELIGIBILITY_CHECK_READY",
|
|
413
|
+
PROFILE_ELIGIBILITY_CHECK_ERROR = "PROFILE_ELIGIBILITY_CHECK_ERROR",
|
|
412
414
|
SEARCH_INSTITUTION = "SEARCH_INSTITUTION",
|
|
413
415
|
SELECT_DEGRADED_INSTITUTION = "SELECT_DEGRADED_INSTITUTION",
|
|
414
416
|
SELECT_DOWN_INSTITUTION = "SELECT_DOWN_INSTITUTION",
|
|
@@ -482,6 +484,12 @@ export interface PlaidLinkProps {
|
|
|
482
484
|
logLevel?: LinkLogLevel;
|
|
483
485
|
onPress?(): any;
|
|
484
486
|
}
|
|
487
|
+
export interface LinkOpenProps {
|
|
488
|
+
onSuccess: LinkSuccessListener;
|
|
489
|
+
onExit?: LinkExitListener;
|
|
490
|
+
iOSPresentationStyle?: LinkIOSPresentationStyle;
|
|
491
|
+
logLevel?: LinkLogLevel;
|
|
492
|
+
}
|
|
485
493
|
export type PlaidLinkComponentProps = (PlaidLinkProps & {
|
|
486
494
|
children: React.ReactNode;
|
|
487
495
|
});
|
package/dist/Types.js
CHANGED
|
@@ -361,6 +361,8 @@ export var LinkEventName;
|
|
|
361
361
|
LinkEventName["OPEN"] = "OPEN";
|
|
362
362
|
LinkEventName["OPEN_MY_PLAID"] = "OPEN_MY_PLAID";
|
|
363
363
|
LinkEventName["OPEN_OAUTH"] = "OPEN_OAUTH";
|
|
364
|
+
LinkEventName["PROFILE_ELIGIBILITY_CHECK_READY"] = "PROFILE_ELIGIBILITY_CHECK_READY";
|
|
365
|
+
LinkEventName["PROFILE_ELIGIBILITY_CHECK_ERROR"] = "PROFILE_ELIGIBILITY_CHECK_ERROR";
|
|
364
366
|
LinkEventName["SEARCH_INSTITUTION"] = "SEARCH_INSTITUTION";
|
|
365
367
|
LinkEventName["SELECT_DEGRADED_INSTITUTION"] = "SELECT_DEGRADED_INSTITUTION";
|
|
366
368
|
LinkEventName["SELECT_DOWN_INSTITUTION"] = "SELECT_DOWN_INSTITUTION";
|
package/ios/RNLinksdk.m
CHANGED
|
@@ -27,7 +27,7 @@ static NSString* const kRNLinkKitVersionConstant = @"version";
|
|
|
27
27
|
RCT_EXPORT_MODULE();
|
|
28
28
|
|
|
29
29
|
+ (NSString*)sdkVersion {
|
|
30
|
-
return @"11.
|
|
30
|
+
return @"11.7.0"; // SDK_VERSION
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
+ (NSString*)objCBridgeVersion {
|
|
@@ -415,6 +415,10 @@ RCT_EXPORT_METHOD(dismiss) {
|
|
|
415
415
|
return @"OPEN_MY_PLAID";
|
|
416
416
|
case PLKEventNameValueOpenOAuth:
|
|
417
417
|
return @"OPEN_OAUTH";
|
|
418
|
+
case PLKEventNameValueProfileEligibilityCheckReady:
|
|
419
|
+
return @"PROFILE_ELIGIBILITY_CHECK_READY";
|
|
420
|
+
case PLKEventNameValueProfileEligibilityCheckError:
|
|
421
|
+
return @"PROFILE_ELIGIBILITY_CHECK_ERROR";
|
|
418
422
|
case PLKEventNameValueSearchInstitution:
|
|
419
423
|
return @"SEARCH_INSTITUTION";
|
|
420
424
|
case PLKEventNameValueSelectDegradedInstitution:
|
package/ios/RNLinksdk.xcworkspace/xcuserdata/dtroupe.xcuserdatad/UserInterfaceState.xcuserstate
CHANGED
|
Binary file
|
package/package.json
CHANGED