react-native-plaid-link-sdk 10.3.0 → 10.5.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 +77 -108
- package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/build.gradle +1 -2
- package/android/src/main/AndroidManifest.xml +1 -1
- package/dist/PlaidLink.d.ts +2 -1
- package/dist/PlaidLink.js +3 -1
- package/dist/Types.d.ts +5 -0
- package/dist/Types.js +8 -0
- package/dist/__tests__/Types.tests.d.ts +1 -0
- package/dist/__tests__/Types.tests.js +14 -0
- package/ios/RNLinksdk.m +8 -2
- package/ios/RNLinksdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNLinksdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNLinksdk.xcodeproj/project.xcworkspace/xcuserdata/dtroupe.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNLinksdk.xcodeproj/xcuserdata/dtroupe.xcuserdatad/xcschemes/xcschememanagement.plist +5 -0
- package/ios/RNLinksdk.xcworkspace/xcuserdata/dtroupe.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +11 -10
- package/react-native-plaid-link-sdk.podspec +1 -1
- package/android/.gradle/6.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.1/gc.properties +0 -0
- package/dist/check_version_hook.d.ts +0 -1
- package/dist/check_version_hook.js +0 -11
package/README.md
CHANGED
|
@@ -1,102 +1,78 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Plaid React Native SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
[](https://github.com/plaid/react-native-plaid-link-sdk/blob/master/LICENSE)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
npm install --save react-native-plaid-link-sdk
|
|
7
|
-
```
|
|
6
|
+
The Plaid React Native SDK provides the client-side component that your users will interact with in order to link their accounts to Plaid and allow you access to their accounts via the Plaid API.
|
|
8
7
|
|
|
9
|
-
For
|
|
8
|
+
For more information about Plaid Link check out our
|
|
9
|
+
[introduction documentation](https://plaid.com/docs/link/#introduction-to-link).
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
Add `Plaid` to your project’s Podfile as follows (likely located at `ios/Podfile`). The latest version is .
|
|
11
|
+
## Features
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
pod 'Plaid', '~> <insert latest version>'
|
|
16
|
-
```
|
|
13
|
+
The SDK provides:
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
- A PlaidLink functional component.
|
|
16
|
+
- A function to open Link.
|
|
17
|
+
- A hook to handle [onEvent](https://plaid.com/docs/link/react-native/#onevent) callbacks.
|
|
18
|
+
- A function to dismiss link on iOS.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
(cd ios && pod install)
|
|
22
|
-
```
|
|
20
|
+
## Getting Started
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
Get started with our 📝 [documentation](https://plaid.com/docs/link/react-native/) and the 📱[example project](https://github.com/plaid/react-native-plaid-link-sdk/blob/master/example/README.md), or ↔️ [Tiny Quickstart (React Native)](https://github.com/plaid/tiny-quickstart/tree/main/react_native) which is an end to end example demonstrating a minimal integration with this SDK.
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
If you're unfamiliar with React Native we recommend starting with the [environment setup instructions](https://reactnative.dev/docs/environment-setup).
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
In your React Native project directory:
|
|
29
27
|
|
|
30
28
|
```sh
|
|
31
|
-
|
|
29
|
+
npm install --save react-native-plaid-link-sdk
|
|
32
30
|
```
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
### iOS Setup
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
2. Go to `node_modules` ▶ `react-native-plaid-link-sdk` ▶ `ios` and add `RNLinksdk.xcodeproj`
|
|
38
|
-
3. In Xcode, in the project navigator, select your project. Add `libRNLinksdk.a` to your project's `Build Phases` ▶ `Link Binary With Libraries`
|
|
39
|
-
4. Run your project (`Cmd+R`)<
|
|
40
|
-
|
|
41
|
-
### OAuth Requirements
|
|
34
|
+
Add `Plaid` to your project’s Podfile as follows (likely located at `ios/Podfile`). The latest version is .
|
|
42
35
|
|
|
43
|
-
|
|
36
|
+
Autolinking should install the CocoaPods dependencies for iOS project. If it fails you can run
|
|
44
37
|
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
```sh
|
|
39
|
+
cd ios && bundle install && bundle exec pod install
|
|
40
|
+
```
|
|
47
41
|
|
|
42
|
+
### Android Setup
|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
- Android 5.0 (API level 21) and above.
|
|
45
|
+
- Your `compileSdkVersion` must be `33`.
|
|
46
|
+
- Android gradle plugin `4.x` and above.
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
1. Log into your [Plaid Dashboard][plaid_dashboard] at the API page
|
|
54
|
-
2. Next to Allowed Android package names click "Configure" then "Add New Android Package Name"
|
|
55
|
-
3. Enter your package name, for example `com.plaid.example`
|
|
56
|
-
4. Click "Save Changes", you may be prompted to re-enter your password
|
|
48
|
+
AutoLinking should handle all of the Android setup.
|
|
57
49
|
|
|
58
|
-
### 2. Add PlaidPackage to your application
|
|
59
|
-
1. Go to `android/app/src/main/java/<AppName>/MainApplication.java`
|
|
60
|
-
2. Add `import com.plaid.PlaidPackage;` to the imports section
|
|
61
|
-
3. Add `packages.add(new PlaidPackage());` to `List<ReactPackage> getPackages();`
|
|
62
50
|
|
|
63
|
-
###
|
|
64
|
-
1. Go to the project level `android/app/build.gradle`
|
|
65
|
-
2. Make sure you are using a min sdk >= 21
|
|
66
|
-
3. Add the following dependencies:
|
|
51
|
+
### React Native Setup
|
|
67
52
|
|
|
68
|
-
|
|
69
|
-
dependencies {
|
|
70
|
-
// ...
|
|
71
|
-
implementation project(':react-native-plaid-link-sdk')
|
|
72
|
-
}
|
|
73
|
-
```
|
|
53
|
+
- 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.
|
|
74
54
|
|
|
75
|
-
|
|
76
|
-
6. Add the following lines:
|
|
77
|
-
|
|
78
|
-
```groovy
|
|
79
|
-
include ':react-native-plaid-link-sdk'
|
|
80
|
-
project(':react-native-plaid-link-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-plaid-link-sdk/android')
|
|
81
|
-
```
|
|
82
|
-
4. (Optional) Run `npx react-native link`
|
|
83
|
-
|
|
84
|
-
## React native setup
|
|
85
|
-
To initialize `PlaidLink`, you will need to first create a `link_token` at [/link/token/create][plaid_tokendocs].
|
|
86
|
-
After creating a `link_token`, you'll need to pass it into your app and use it to launch Link:
|
|
55
|
+
- After creating a `link_token`, you'll need to pass it into your app and use it to launch Link:
|
|
87
56
|
|
|
88
57
|
```javascript
|
|
89
58
|
import { Text } from 'react-native';
|
|
90
|
-
import { PlaidLink, LinkSuccess, LinkExit } from 'react-native-plaid-link-sdk';
|
|
59
|
+
import { PlaidLink, LinkSuccess, LinkExit, LinkLogLevel, LinkIOSPresentationStyle } from 'react-native-plaid-link-sdk';
|
|
91
60
|
|
|
92
61
|
const MyPlaidComponent = () => {
|
|
93
62
|
return (
|
|
94
63
|
<PlaidLink
|
|
95
64
|
tokenConfig={{
|
|
96
65
|
token: "#GENERATED_LINK_TOKEN#",
|
|
66
|
+
// OPTIONAL - log level.
|
|
67
|
+
logLevel: LinkLogLevel.ERROR,
|
|
68
|
+
// OPTIONAL - Hides native activity indicator if true.
|
|
69
|
+
noLoadingState: false,
|
|
97
70
|
}}
|
|
98
71
|
onSuccess={(success: LinkSuccess) => { console.log(success) }}
|
|
99
72
|
onExit={(exit: LinkExit) => { console.log(exit) }}
|
|
73
|
+
// OPTIONAL - MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
|
|
74
|
+
// UI is always presented in full screen on Android.
|
|
75
|
+
iOSPresentationStyle={LinkIOSPresentationStyle.MODAL}
|
|
100
76
|
>
|
|
101
77
|
<Text>Add Account</Text>
|
|
102
78
|
</PlaidLink>
|
|
@@ -106,19 +82,35 @@ const MyPlaidComponent = () => {
|
|
|
106
82
|
|
|
107
83
|
`PlaidLink` wraps the view you provide as a child with a `Pressable` component and intercepts the `onPress` event.
|
|
108
84
|
|
|
109
|
-
|
|
85
|
+
#### OAuth requirements
|
|
86
|
+
|
|
87
|
+
:warning: All integrations must migrate to version 9.0.0 or later of the React Native SDK (requires version 4.1.0 or later of the iOS LinkKit SDK) by September 30, 2023, to maintain support for Chase OAuth on iOS.
|
|
88
|
+
|
|
89
|
+
##### Android OAuth Requirements
|
|
90
|
+
|
|
91
|
+
###### Register your app package name
|
|
92
|
+
1. Log into your [Plaid Dashboard](https://dashboard.plaid.com/developers/api) and navigate to the API page under the Developers tab.
|
|
93
|
+
2. Next to Allowed Android package names click "Configure" then "Add New Android Package Name".
|
|
94
|
+
3. Enter your package name, for example `com.plaid.example`.
|
|
95
|
+
4. Click "Save Changes", you may be prompted to re-enter your password.
|
|
96
|
+
|
|
97
|
+
##### iOS OAuth Requirements
|
|
98
|
+
|
|
99
|
+
For iOS OAuth to work, specific requirements must be met.
|
|
100
|
+
1. Redirect URIs must be [registered](https://plaid.com/docs/link/ios/#register-your-redirect-uri), and set up as [universal links](https://developer.apple.com/documentation/xcode/supporting-associated-domains).
|
|
101
|
+
2. Your native iOS application, must be configured with your associated domain. See your iOS [set up universal links](https://plaid.com/docs/link/ios/#set-up-universal-links) for more information.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
##### Link Token OAuth Requirements
|
|
110
105
|
|
|
111
|
-
|
|
106
|
+
- On iOS you must configure your `link_token` with a [redirect_uri](https://plaid.com/docs/api/tokens/#link-token-create-request-redirect-uri) to support OAuth. When creating a `link_token` for initializing Link on Android, `android_package_name` must be specified and `redirect_uri` must be left blank.
|
|
112
107
|
|
|
113
|
-
|
|
114
|
-
1. `oauthRedirectUri` this is the same uri you would pass to the `redirect_uri` for Link Token based OAuth. It must be registered as a universal link.
|
|
115
|
-
2. `oauthNonce` this is a 16 character nonce.
|
|
108
|
+
- On Android you must configure your `link_token` with an [android_package_name](https://plaid.com/docs/api/tokens/#link-token-create-request-android-package-name) to support OAuth. When creating a `link_token` for initializing Link on iOS, `android_package_name` must be left blank and `redirect_uri` should be used instead.
|
|
116
109
|
|
|
117
|
-
In order for the React Native app to respond to the universal link, you will need to update your AppDelegate to inform the React Native Linking library when the universal link is received. See [OAuth requirements][plaid_oauthdocs] for more information.
|
|
118
110
|
|
|
119
|
-
|
|
111
|
+
#### To receive onEvent callbacks:
|
|
120
112
|
|
|
121
|
-
The React Native Plaid module emits `onEvent` events throughout the account linking process — see [details here]
|
|
113
|
+
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, wrap the `PlaidLink` react component with the following in order to listen for those events:
|
|
122
114
|
|
|
123
115
|
```javascript
|
|
124
116
|
import React from 'react';
|
|
@@ -149,44 +141,21 @@ You can also use the `usePlaidEmitter` hook in react functional components:
|
|
|
149
141
|
})
|
|
150
142
|
```
|
|
151
143
|
|
|
152
|
-
##
|
|
153
|
-
|
|
154
|
-
We create release candidates (e.g. 7.0.0-rc1) as beta previews for developers. These are helpful for customers who either are 1. waiting for a specific fix or 2. extremely eager for specific features. They do not hold the same quality guarantee as our official releases, and should NOT be used in production. The official releases come ~2 weeks after the first release candidate (rc1).
|
|
155
|
-
|
|
156
|
-
The latest stable version is the highest version without the suffix `-rcX`.
|
|
157
|
-
|
|
158
|
-
## Updating from previous versions.
|
|
159
|
-
|
|
160
|
-
When upgrading from a previous major version of this library, see the following notes for additional instructions:
|
|
161
|
-
|
|
162
|
-
- Upgrading [pre 5.x](./upgrade_notes)
|
|
163
|
-
- Upgrading [from 5.x onwards][upgrading]
|
|
164
|
-
|
|
165
|
-
# Version compatibility
|
|
166
|
-
| React Native SDK | Android SDK | iOS SDK | Status |
|
|
167
|
-
|---|---|---|---|
|
|
168
|
-
| 10.3.0 | [3.12.1+] | >=4.3.0 | Active, supports Xcode 14 |
|
|
169
|
-
| 10.2.0 | [3.12.0+] | >=4.3.0 | Deprecated, supports Xcode 14 |
|
|
170
|
-
| 10.1.0 | [3.11.0+] | >=4.2.0 | Deprecated, supports Xcode 14 |
|
|
171
|
-
| 10.0.0 | [3.10.1+] | >=4.1.0 | Deprecated, supports Xcode 14 |
|
|
172
|
-
| 9.x.x | [3.10.1+] | >=4.1.0 | Deprecated, supports Xcode 14 |
|
|
173
|
-
| 8.x.x | [3.10.1+] | >=3.1.0 | Deprecated, supports Xcode 14 |
|
|
174
|
-
| 7.x.x | [3.2.0+] | >=2.0.11 | Deprecated, supports Xcode <= 13 |
|
|
175
|
-
| 6.x.x | [3.0.0-3.2.0) | >=2.0.1 | Deprecated |
|
|
176
|
-
| 5.x.x | [2.1.0-3.0.0) | >=1.1.34 | Deprecated |
|
|
177
|
-
| 4.x.x | [2.0.0-2.1.0) | <=1.1.33 | Deprecated |
|
|
178
|
-
| 3.x.x | [1.0.0-2.0.0) | <=1.1.33 | Deprecated |
|
|
179
|
-
| 2.x.x | [0.3.0-1.0.0) | <=1.1.27 | Deprecated |
|
|
180
|
-
| 1.x.x | [0.1.0-0.3.0) | <=1.1.24 | Deprecated |
|
|
144
|
+
## Version compatibility
|
|
181
145
|
|
|
146
|
+
| Plaid SDK Version | Min React Native Version | Android SDK | Android Min Version | Android Compile Version| iOS SDK | iOS Min Version | Status |
|
|
147
|
+
|-------------------|--------------------------|-------------|---------------------|------------------------|---------|-----------------|-------------------------------|
|
|
148
|
+
| 10.5.0 | >= 0.66.0 | [3.12.2+] | 21 | 33 | >=4.5.1 | 11.0 | Active, supports Xcode 14 |
|
|
149
|
+
| 10.4.0 | >= 0.66.0 | [3.12.2+] | 21 | 33 | >=4.4.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
150
|
+
| 10.3.0 | >= 0.66.0 | [3.12.1+] | 21 | 33 | >=4.3.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
151
|
+
| 10.2.0 | >= 0.66.0 | [3.12.0+] | 21 | 33 | >=4.3.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
152
|
+
| 10.1.0 | >= 0.66.0 | [3.11.0+] | 21 | 33 | >=4.2.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
153
|
+
| 10.0.0 | >= 0.66.0 | [3.10.1+] | 21 | 33 | >=4.1.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
154
|
+
| 9.1.0 | >= 0.65.3 | [3.13.2+] | 21 | 33 | >=4.4.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
155
|
+
| 9.0.1 | >= 0.65.3 | [3.10.1+] | 21 | 33 | >=4.1.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
156
|
+
| 9.0.0 | >= 0.65.3 | [3.10.1+] | 21 | 33 | >=4.1.0 | 11.0 | Deprecated, supports Xcode 14 |
|
|
182
157
|
|
|
183
158
|
|
|
184
|
-
|
|
185
|
-
[plaid_rndocs]: https://plaid.com/docs/link/react-native/
|
|
186
|
-
[plaid_oauthdocs]: https://plaid.com/docs/#oauth
|
|
187
|
-
[plaid_eventdocs]: https://plaid.com/docs/#onevent-callback
|
|
188
|
-
[plaid_tokendocs]: https://plaid.com/docs/#create-link-token
|
|
159
|
+
## Contributing
|
|
189
160
|
|
|
190
|
-
[
|
|
191
|
-
[turbomodules]: https://github.com/react-native-community/discussions-and-proposals/issues/40
|
|
192
|
-
[upgrading]: https://plaid.com/docs/link/react-native/#upgrading
|
|
161
|
+
See the [contributor guidelines](CONTRIBUTING.md) to learn how to contribute to the repository.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Fri Jul 21 10:43:21 PDT 2023
|
|
2
2
|
gradle.version=6.9
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -27,7 +27,6 @@ buildscript {
|
|
|
27
27
|
|
|
28
28
|
apply plugin: 'com.android.library'
|
|
29
29
|
apply plugin: "kotlin-android"
|
|
30
|
-
apply plugin: "kotlin-android-extensions"
|
|
31
30
|
|
|
32
31
|
android {
|
|
33
32
|
compileSdkVersion 31
|
|
@@ -64,7 +63,7 @@ repositories {
|
|
|
64
63
|
|
|
65
64
|
dependencies {
|
|
66
65
|
implementation "com.facebook.react:react-native:+"
|
|
67
|
-
implementation "com.plaid.link:sdk-core:3.
|
|
66
|
+
implementation "com.plaid.link:sdk-core:3.13.2"
|
|
68
67
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
69
68
|
implementation "com.jakewharton.rxrelay2:rxrelay:2.1.1"
|
|
70
69
|
}
|
package/dist/PlaidLink.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { LinkEventListener, PlaidLinkComponentProps, PlaidLinkProps } from './Types';
|
|
2
3
|
/**
|
|
3
4
|
* A hook that registers a listener on the Plaid emitter for the 'onEvent' type.
|
|
@@ -8,4 +9,4 @@ import { LinkEventListener, PlaidLinkComponentProps, PlaidLinkProps } from './Ty
|
|
|
8
9
|
export declare const usePlaidEmitter: (LinkEventListener: LinkEventListener) => void;
|
|
9
10
|
export declare const openLink: (props: PlaidLinkProps) => Promise<void>;
|
|
10
11
|
export declare const dismissLink: () => void;
|
|
11
|
-
export declare const PlaidLink: (props: PlaidLinkComponentProps) => JSX.Element;
|
|
12
|
+
export declare const PlaidLink: (props: PlaidLinkComponentProps) => React.JSX.Element;
|
package/dist/PlaidLink.js
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import React, { useEffect } from 'react';
|
|
11
11
|
import { NativeEventEmitter, NativeModules, Platform, TouchableOpacity, } from 'react-native';
|
|
12
|
+
import { LinkIOSPresentationStyle, } from './Types';
|
|
12
13
|
/**
|
|
13
14
|
* A hook that registers a listener on the Plaid emitter for the 'onEvent' type.
|
|
14
15
|
* The listener is cleaned up when this view is unmounted
|
|
@@ -49,7 +50,8 @@ export const openLink = (props) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
49
50
|
}
|
|
50
51
|
else {
|
|
51
52
|
NativeModules.RNLinksdk.create(config);
|
|
52
|
-
|
|
53
|
+
let presentFullScreen = props.iOSPresentationStyle == LinkIOSPresentationStyle.FULL_SCREEN;
|
|
54
|
+
NativeModules.RNLinksdk.open(presentFullScreen, (result) => {
|
|
53
55
|
if (props.onSuccess != null) {
|
|
54
56
|
props.onSuccess(result);
|
|
55
57
|
}
|
package/dist/Types.d.ts
CHANGED
|
@@ -390,6 +390,10 @@ export declare enum LinkEventViewName {
|
|
|
390
390
|
SELECT_INSTITUTION = "SELECT_INSTITUTION",
|
|
391
391
|
VERIFY_SMS = "VERIFY_SMS"
|
|
392
392
|
}
|
|
393
|
+
export declare enum LinkIOSPresentationStyle {
|
|
394
|
+
FULL_SCREEN = 0,
|
|
395
|
+
MODAL = 1
|
|
396
|
+
}
|
|
393
397
|
export type LinkSuccessListener = (LinkSuccess: LinkSuccess) => void;
|
|
394
398
|
export type LinkExitListener = (LinkExit: LinkExit) => void;
|
|
395
399
|
export type PlaidLinkConfiguration = LinkTokenConfiguration | LinkPublicKeyConfiguration;
|
|
@@ -398,6 +402,7 @@ export interface PlaidLinkProps {
|
|
|
398
402
|
publicKeyConfig?: LinkPublicKeyConfiguration;
|
|
399
403
|
onSuccess: LinkSuccessListener;
|
|
400
404
|
onExit?: LinkExitListener;
|
|
405
|
+
iOSPresentationStyle?: LinkIOSPresentationStyle;
|
|
401
406
|
onPress?(): any;
|
|
402
407
|
}
|
|
403
408
|
export type PlaidLinkComponentProps = (PlaidLinkProps & {
|
package/dist/Types.js
CHANGED
|
@@ -393,3 +393,11 @@ export var LinkEventViewName;
|
|
|
393
393
|
LinkEventViewName["SELECT_INSTITUTION"] = "SELECT_INSTITUTION";
|
|
394
394
|
LinkEventViewName["VERIFY_SMS"] = "VERIFY_SMS";
|
|
395
395
|
})(LinkEventViewName || (LinkEventViewName = {}));
|
|
396
|
+
/// Methods to present Link on iOS.
|
|
397
|
+
/// FULL_SCREEN is the converts to UIModalPresentationOverFullScreen on the native side.
|
|
398
|
+
/// MODAL will use the default presentation style for iOS which is UIModalPresentationAutomatic.
|
|
399
|
+
export var LinkIOSPresentationStyle;
|
|
400
|
+
(function (LinkIOSPresentationStyle) {
|
|
401
|
+
LinkIOSPresentationStyle[LinkIOSPresentationStyle["FULL_SCREEN"] = 0] = "FULL_SCREEN";
|
|
402
|
+
LinkIOSPresentationStyle[LinkIOSPresentationStyle["MODAL"] = 1] = "MODAL";
|
|
403
|
+
})(LinkIOSPresentationStyle || (LinkIOSPresentationStyle = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare const Types: any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const Types = require('./../Types');
|
|
3
|
+
test('test token configuration', () => {
|
|
4
|
+
const linkTokenConfiguration = {
|
|
5
|
+
token: "test-token",
|
|
6
|
+
noLoadingState: false,
|
|
7
|
+
logLevel: Types.LinkLogLevel.DEBUG,
|
|
8
|
+
extras: null,
|
|
9
|
+
};
|
|
10
|
+
expect(linkTokenConfiguration.noLoadingState).toBe(false);
|
|
11
|
+
expect(linkTokenConfiguration.token).toBe("test-token");
|
|
12
|
+
expect(linkTokenConfiguration.logLevel).toBe(Types.LinkLogLevel.DEBUG);
|
|
13
|
+
expect(linkTokenConfiguration.extras).toBe(null);
|
|
14
|
+
});
|
package/ios/RNLinksdk.m
CHANGED
|
@@ -117,7 +117,7 @@ NSString* const kRNLinkKitPublicTokenPrefix = @"public-";
|
|
|
117
117
|
RCT_EXPORT_MODULE();
|
|
118
118
|
|
|
119
119
|
+ (NSString*)sdkVersion {
|
|
120
|
-
return @"10.
|
|
120
|
+
return @"10.5.0"; // SDK_VERSION
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
+ (NSString*)objCBridgeVersion {
|
|
@@ -232,7 +232,7 @@ RCT_EXPORT_METHOD(create:(NSDictionary*)configuration) {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
RCT_EXPORT_METHOD(open:(RCTResponseSenderBlock)onSuccess :(RCTResponseSenderBlock)onExit) {
|
|
235
|
+
RCT_EXPORT_METHOD(open: (BOOL)fullScreen :(RCTResponseSenderBlock)onSuccess :(RCTResponseSenderBlock)onExit) {
|
|
236
236
|
if (self.linkHandler) {
|
|
237
237
|
self.successCallback = onSuccess;
|
|
238
238
|
self.exitCallback = onExit;
|
|
@@ -245,6 +245,12 @@ RCT_EXPORT_METHOD(open:(RCTResponseSenderBlock)onSuccess :(RCTResponseSenderBloc
|
|
|
245
245
|
|
|
246
246
|
__weak typeof(self) weakSelf = self;
|
|
247
247
|
void(^presentationHandler)(UIViewController *) = ^(UIViewController *linkViewController) {
|
|
248
|
+
|
|
249
|
+
if (fullScreen) {
|
|
250
|
+
[linkViewController setModalPresentationStyle:UIModalPresentationOverFullScreen];
|
|
251
|
+
[linkViewController setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
|
|
252
|
+
}
|
|
253
|
+
|
|
248
254
|
[weakSelf.presentingViewController presentViewController:linkViewController animated:YES completion:nil];
|
|
249
255
|
didPresent = YES;
|
|
250
256
|
};
|
|
Binary file
|
package/ios/RNLinksdk.xcworkspace/xcuserdata/dtroupe.xcuserdatad/UserInterfaceState.xcuserstate
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-plaid-link-sdk",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"description": "React Native Plaid Link SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,13 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"lint": "eslint \"./**/*.{js,jsx}\" --fix",
|
|
15
15
|
"prettier": "prettier \"./**/*.{js,jsx}\" --write",
|
|
16
|
-
"test": "
|
|
17
|
-
"preversion": "sed -i\"\" -e s\"#^.*\\(; // SDK_VERSION\\)#return @\\\"$npm_package_version\\\"\\1#\" ios/RNLinksdk.m",
|
|
18
|
-
"version": "git add -A",
|
|
19
|
-
"postversion": "git push && git push --tags && rm -rf dist/temp",
|
|
20
|
-
"compile-typescript": "tsc",
|
|
21
|
-
"check-version": "node check_version_hook.js",
|
|
22
|
-
"prepublishOnly": "tsc"
|
|
16
|
+
"test": "jest"
|
|
23
17
|
},
|
|
24
18
|
"keywords": [
|
|
25
19
|
"react-native",
|
|
@@ -27,7 +21,7 @@
|
|
|
27
21
|
],
|
|
28
22
|
"husky": {
|
|
29
23
|
"hooks": {
|
|
30
|
-
"pre-commit": "lint-staged
|
|
24
|
+
"pre-commit": "lint-staged"
|
|
31
25
|
}
|
|
32
26
|
},
|
|
33
27
|
"lint-staged": {
|
|
@@ -37,6 +31,12 @@
|
|
|
37
31
|
"git add"
|
|
38
32
|
]
|
|
39
33
|
},
|
|
34
|
+
"jest": {
|
|
35
|
+
"testPathIgnorePatterns": [
|
|
36
|
+
"/node_modules/",
|
|
37
|
+
"/example/"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
40
|
"author": "Plaid",
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"peerDependencies": {
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"eslint-plugin-prettier": "^3.1.4",
|
|
57
57
|
"eslint-plugin-react": "^7.16.0",
|
|
58
58
|
"husky": "^3.1.0",
|
|
59
|
+
"jest": "^29.6.1",
|
|
59
60
|
"lint-staged": "^9.4.2",
|
|
60
61
|
"prettier": "^1.18.2",
|
|
61
62
|
"react": "17.0.2",
|
|
@@ -64,6 +65,6 @@
|
|
|
64
65
|
"xyz": "0.5.x"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
|
-
"react-native-plaid-link-sdk": "^10.
|
|
68
|
+
"react-native-plaid-link-sdk": "^10.4.0"
|
|
68
69
|
}
|
|
69
70
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const rn_version = JSON.parse(fs.readFileSync('package.json', 'utf-8'))['version'];
|
|
4
|
-
const android_version = fs
|
|
5
|
-
.readFileSync('android/src/main/AndroidManifest.xml', 'utf-8')
|
|
6
|
-
.match(/(?<=value=").*(?=")/)[0];
|
|
7
|
-
if (rn_version != android_version) {
|
|
8
|
-
console.error('Commit failed SDK version mismatch');
|
|
9
|
-
console.error('Please ensure package.json and android/src/main/AndroidManifest.xml have the same version');
|
|
10
|
-
process.exit(-1);
|
|
11
|
-
}
|