react-native-plaid-link-sdk 11.6.0 → 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 +87 -63
- package/android/build.gradle +1 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/dist/PlaidLink.js +2 -2
- package/ios/RNLinksdk.m +1 -1
- 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,18 +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.5.
|
|
163
|
-
| 11.
|
|
164
|
-
| 11.
|
|
165
|
-
|
|
|
166
|
-
| 11.
|
|
167
|
-
| 11.0
|
|
168
|
-
| 11.0.
|
|
169
|
-
| 11.0.
|
|
170
|
-
| 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 |
|
|
171
195
|
| 10.13.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.2 | 11.0 | Active, supports Xcode 14 |
|
|
172
196
|
| 10.12.0 | >= 0.66.0 | [3.14.3+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
|
|
173
197
|
| 10.11.0 | >= 0.66.0 | [3.14.1+] | 21 | 33 | >=4.7.1 | 11.0 | Active, supports Xcode 14 |
|
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
|
}
|
package/dist/PlaidLink.js
CHANGED
|
@@ -84,10 +84,10 @@ export const dismissLink = () => {
|
|
|
84
84
|
* @deprecated This component is deprecated. Create your own component and use the create & open methods.
|
|
85
85
|
*/
|
|
86
86
|
export const PlaidLink = (props) => {
|
|
87
|
-
// Create a handler.
|
|
88
|
-
create(props.tokenConfig);
|
|
89
87
|
function onPress() {
|
|
90
88
|
var _a;
|
|
89
|
+
// Create a handler.
|
|
90
|
+
create(props.tokenConfig);
|
|
91
91
|
(_a = props.onPress) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
92
92
|
const openProps = {
|
|
93
93
|
onSuccess: props.onSuccess,
|
package/ios/RNLinksdk.m
CHANGED
package/package.json
CHANGED