react-native-plaid-link-sdk 12.6.1 → 12.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 +1 -0
- package/android/build.gradle +1 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/plaid/PlaidModule.kt +10 -1
- package/android/src/paper/java/com/plaid/NativePlaidLinkModuleAndroidSpec.java +1 -1
- package/dist/PlaidLink.js +4 -3
- package/dist/Types.d.ts +1 -0
- package/dist/fabric/NativePlaidLinkModuleAndroid.d.ts +1 -1
- package/dist/fabric/NativePlaidLinkModuleiOS.d.ts +1 -1
- package/dist/src/Types.d.ts +1 -0
- package/ios/RNLinksdk.mm +13 -3
- package/ios/RNPlaidHelper.h +1 -0
- package/ios/RNPlaidHelper.m +3 -1
- package/package.json +1 -1
- package/src/PlaidLink.tsx +3 -1
- package/src/Types.ts +2 -0
- package/src/fabric/NativePlaidLinkModuleAndroid.ts +1 -1
- package/src/fabric/NativePlaidLinkModuleiOS.ts +1 -1
package/README.md
CHANGED
|
@@ -215,6 +215,7 @@ If migrating from older versions, see the [docs](https://plaid.com/docs/link/rea
|
|
|
215
215
|
|
|
216
216
|
| Plaid SDK Version | Min React Native Version | Android SDK | Android Min Version | Android Compile Version| iOS SDK | iOS Min Version | Status |
|
|
217
217
|
|-------------------|--------------------------|-------------|---------------------|------------------------|---------|-----------------|-------------------------------|
|
|
218
|
+
| 12.7.0 | * | [5.5.0+] | 21 | 34 | >=6.4.2 | 14.0 | Active, supports Xcode 16.1.0 |
|
|
218
219
|
| 12.6.1 | * | [5.4.0+] | 21 | 34 | >=6.4.2 | 14.0 | Active, supports Xcode 16.1.0 |
|
|
219
220
|
| 12.6.0 | * | [5.4.0+] | 21 | 34 | >=6.4.1 | 14.0 | Active, supports Xcode 16.1.0 |
|
|
220
221
|
| 12.5.3 | * | [5.3.4+] | 21 | 34 | >=6.4.0 | 14.0 | Active, supports Xcode 16.1.0 |
|
package/android/build.gradle
CHANGED
|
@@ -106,6 +106,6 @@ repositories {
|
|
|
106
106
|
|
|
107
107
|
dependencies {
|
|
108
108
|
implementation "com.facebook.react:react-native:+"
|
|
109
|
-
implementation "com.plaid.link:sdk-core:5.
|
|
109
|
+
implementation "com.plaid.link:sdk-core:5.5.0"
|
|
110
110
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
111
111
|
}
|
|
@@ -17,6 +17,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
|
17
17
|
import com.plaid.gson.PlaidJsonConverter
|
|
18
18
|
import com.plaid.link.Plaid
|
|
19
19
|
import com.plaid.link.PlaidHandler
|
|
20
|
+
import com.plaid.link.OnLoadCallback
|
|
20
21
|
import com.plaid.link.configuration.LinkLogLevel
|
|
21
22
|
import com.plaid.link.configuration.LinkTokenConfiguration
|
|
22
23
|
import com.plaid.link.event.LinkEvent
|
|
@@ -98,6 +99,7 @@ class PlaidModule internal constructor(reactContext: ReactApplicationContext) :
|
|
|
98
99
|
token: String,
|
|
99
100
|
noLoadingState: Boolean,
|
|
100
101
|
logLevel: String,
|
|
102
|
+
onLoad: Callback,
|
|
101
103
|
) {
|
|
102
104
|
val tokenConfiguration = getLinkTokenConfiguration(token, noLoadingState, getLogLevel(logLevel))
|
|
103
105
|
if (tokenConfiguration == null) {
|
|
@@ -120,7 +122,14 @@ class PlaidModule internal constructor(reactContext: ReactApplicationContext) :
|
|
|
120
122
|
// Create Plaid handler.
|
|
121
123
|
this.plaidHandler = Plaid.create(
|
|
122
124
|
reactApplicationContext.getApplicationContext() as Application,
|
|
123
|
-
tokenConfiguration
|
|
125
|
+
tokenConfiguration,
|
|
126
|
+
onLoad = OnLoadCallback {
|
|
127
|
+
try {
|
|
128
|
+
onLoad.invoke()
|
|
129
|
+
} catch (e: Exception) {
|
|
130
|
+
Log.e("PlaidModule", "onLoad callback failed", e)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
124
133
|
)
|
|
125
134
|
}
|
|
126
135
|
|
|
@@ -35,7 +35,7 @@ public abstract class NativePlaidLinkModuleAndroidSpec extends ReactContextBaseJ
|
|
|
35
35
|
|
|
36
36
|
@ReactMethod
|
|
37
37
|
@DoNotStrip
|
|
38
|
-
public abstract void createPlaidLink(String token, boolean noLoadingState, String logLevel);
|
|
38
|
+
public abstract void createPlaidLink(String token, boolean noLoadingState, String logLevel, Callback onLoad);
|
|
39
39
|
|
|
40
40
|
@ReactMethod
|
|
41
41
|
@DoNotStrip
|
package/dist/PlaidLink.js
CHANGED
|
@@ -31,14 +31,15 @@ export const usePlaidEmitter = (linkEventListener) => {
|
|
|
31
31
|
}, []);
|
|
32
32
|
};
|
|
33
33
|
export const create = (props) => {
|
|
34
|
-
var _a, _b;
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
35
|
let token = props.token;
|
|
36
36
|
let noLoadingState = (_a = props.noLoadingState) !== null && _a !== void 0 ? _a : false;
|
|
37
37
|
if (Platform.OS === 'android') {
|
|
38
|
-
RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.createPlaidLink(token, noLoadingState, (_b = props.logLevel) !== null && _b !== void 0 ? _b : LinkLogLevel.ERROR);
|
|
38
|
+
RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.createPlaidLink(token, noLoadingState, (_b = props.logLevel) !== null && _b !== void 0 ? _b : LinkLogLevel.ERROR, (_c = props.onLoad) !== null && _c !== void 0 ? _c : (() => { }));
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
|
|
41
|
+
const onLoad = (_d = props.onLoad) !== null && _d !== void 0 ? _d : (() => { });
|
|
42
|
+
RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.createPlaidLink(token, noLoadingState, onLoad);
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
export const open = (props) => {
|
package/dist/Types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
|
3
3
|
import { UnsafeObject } from './fabricUtils';
|
|
4
4
|
import { LinkSuccess, LinkExit } from '../Types';
|
|
5
5
|
export interface Spec extends TurboModule {
|
|
6
|
-
createPlaidLink(token: string, noLoadingState: boolean, logLevel: string): void;
|
|
6
|
+
createPlaidLink(token: string, noLoadingState: boolean, logLevel: string, onLoad: () => void): void;
|
|
7
7
|
open(onSuccess: (result: UnsafeObject<LinkSuccess>) => void, onExit: (result: UnsafeObject<LinkExit>) => void): void;
|
|
8
8
|
destroy(): Promise<void>;
|
|
9
9
|
startLinkActivityForResult(token: string, noLoadingState: boolean, logLevel: string, onSuccessCallback: (result: UnsafeObject<LinkSuccess>) => void, onExitCallback: (result: UnsafeObject<LinkExit>) => void): void;
|
|
@@ -3,7 +3,7 @@ import { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
|
3
3
|
import { UnsafeObject } from './fabricUtils';
|
|
4
4
|
import { LinkSuccess, LinkExit, LinkError, FinanceKitError } from '../Types';
|
|
5
5
|
export interface Spec extends TurboModule {
|
|
6
|
-
createPlaidLink(token: string, noLoadingState: boolean): void;
|
|
6
|
+
createPlaidLink(token: string, noLoadingState: boolean, onLoad: () => void): void;
|
|
7
7
|
open(fullScreen: boolean, onSuccess: (result: UnsafeObject<LinkSuccess>) => void, onExit: (error: UnsafeObject<LinkError>, result: UnsafeObject<LinkExit>) => void): void;
|
|
8
8
|
dismiss(): void;
|
|
9
9
|
submit(phoneNumber: string | undefined, dateOfBirth: string | undefined): void;
|
package/dist/src/Types.d.ts
CHANGED
package/ios/RNLinksdk.mm
CHANGED
|
@@ -28,7 +28,7 @@ static NSString* const kRNLinkKitVersionConstant = @"version";
|
|
|
28
28
|
RCT_EXPORT_MODULE();
|
|
29
29
|
|
|
30
30
|
+ (NSString*)sdkVersion {
|
|
31
|
-
return @"12.
|
|
31
|
+
return @"12.7.0"; // SDK_VERSION
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
+ (NSString*)objCBridgeVersion {
|
|
@@ -67,7 +67,7 @@ RCT_EXPORT_MODULE();
|
|
|
67
67
|
self.hasObservers = NO;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
RCT_EXPORT_METHOD(createPlaidLink:(NSString*)token noLoadingState:(BOOL)noLoadingState) {
|
|
70
|
+
RCT_EXPORT_METHOD(createPlaidLink:(NSString*)token noLoadingState:(BOOL)noLoadingState onLoad:(RCTResponseSenderBlock)onLoad) {
|
|
71
71
|
__weak RNLinksdk *weakSelf = self;
|
|
72
72
|
|
|
73
73
|
void (^onSuccess)(PLKLinkSuccess *) = ^(PLKLinkSuccess *success) {
|
|
@@ -119,7 +119,17 @@ RCT_EXPORT_METHOD(createPlaidLink:(NSString*)token noLoadingState:(BOOL)noLoadin
|
|
|
119
119
|
config.noLoadingState = noLoadingState;
|
|
120
120
|
|
|
121
121
|
NSError *creationError = nil;
|
|
122
|
-
|
|
122
|
+
|
|
123
|
+
void (^onLoadBlock)(void) = ^{
|
|
124
|
+
RNLinksdk *strongSelf = weakSelf;
|
|
125
|
+
if (onLoad) {
|
|
126
|
+
onLoad(@[]);
|
|
127
|
+
}
|
|
128
|
+
// strongSelf intentionally unused; kept for symmetry and potential future use
|
|
129
|
+
(void)strongSelf;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
self.linkHandler = [RNPlaidHelper createWithLinkTokenConfiguration:config onLoad:onLoadBlock error:&creationError];
|
|
123
133
|
self.creationError = creationError;
|
|
124
134
|
}
|
|
125
135
|
|
package/ios/RNPlaidHelper.h
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@interface RNPlaidHelper : NSObject
|
|
4
4
|
|
|
5
5
|
+ (id<PLKHandler> _Nullable)createWithLinkTokenConfiguration:(PLKLinkTokenConfiguration * _Nonnull)linkTokenConfiguration
|
|
6
|
+
onLoad:(void (^_Nullable)(void))onLoad
|
|
6
7
|
error:(NSError * _Nullable * _Nullable)error;
|
|
7
8
|
|
|
8
9
|
+ (void)syncFinanceKit:(NSString * _Nonnull)token
|
package/ios/RNPlaidHelper.m
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
@implementation RNPlaidHelper
|
|
4
4
|
|
|
5
5
|
+ (id<PLKHandler> _Nullable)createWithLinkTokenConfiguration:(PLKLinkTokenConfiguration * _Nonnull)linkTokenConfiguration
|
|
6
|
+
onLoad:(void (^_Nullable)(void))onLoad
|
|
6
7
|
error:(NSError * _Nullable * _Nullable)error
|
|
7
8
|
{
|
|
8
|
-
|
|
9
|
+
// Newer LinkKit Objective-C bridge supports an onLoad callback.
|
|
10
|
+
return [PLKPlaid createWithLinkTokenConfiguration:linkTokenConfiguration onLoad:onLoad error:error];
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
+ (void)syncFinanceKit:(NSString * _Nonnull)token
|
package/package.json
CHANGED
package/src/PlaidLink.tsx
CHANGED
|
@@ -45,9 +45,11 @@ export const create = (props: LinkTokenConfiguration) => {
|
|
|
45
45
|
token,
|
|
46
46
|
noLoadingState,
|
|
47
47
|
props.logLevel ?? LinkLogLevel.ERROR,
|
|
48
|
+
props.onLoad ?? (() => {}),
|
|
48
49
|
);
|
|
49
50
|
} else {
|
|
50
|
-
|
|
51
|
+
const onLoad = props.onLoad ?? (() => {});
|
|
52
|
+
RNLinksdkiOS?.createPlaidLink(token, noLoadingState, onLoad);
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
55
|
|
package/src/Types.ts
CHANGED
|
@@ -12,6 +12,8 @@ export type LinkTokenConfiguration = (CommonPlaidLinkOptions & {
|
|
|
12
12
|
// Note: This should be set to `true` when setting the `eu_config.headless` field in /link/token/create requests to `true`.
|
|
13
13
|
// For reference, see https://plaid.com/docs/api/tokens/#link-token-create-request-eu-config-headless
|
|
14
14
|
noLoadingState?: boolean;
|
|
15
|
+
// Optional callback invoked when Link finishes loading and is ready.
|
|
16
|
+
onLoad?: () => void;
|
|
15
17
|
});
|
|
16
18
|
|
|
17
19
|
export enum LinkLogLevel {
|
|
@@ -6,7 +6,7 @@ import {UnsafeObject} from './fabricUtils';
|
|
|
6
6
|
import {LinkSuccess, LinkExit} from '../Types';
|
|
7
7
|
|
|
8
8
|
export interface Spec extends TurboModule {
|
|
9
|
-
createPlaidLink(token: string, noLoadingState: boolean, logLevel: string): void;
|
|
9
|
+
createPlaidLink(token: string, noLoadingState: boolean, logLevel: string, onLoad: () => void): void;
|
|
10
10
|
open(
|
|
11
11
|
onSuccess: (result: UnsafeObject<LinkSuccess>) => void,
|
|
12
12
|
onExit: (result: UnsafeObject<LinkExit>) => void,
|
|
@@ -6,7 +6,7 @@ import {UnsafeObject} from './fabricUtils';
|
|
|
6
6
|
import {LinkSuccess, LinkExit, LinkError, FinanceKitError} from '../Types';
|
|
7
7
|
|
|
8
8
|
export interface Spec extends TurboModule {
|
|
9
|
-
createPlaidLink(token: string, noLoadingState: boolean): void;
|
|
9
|
+
createPlaidLink(token: string, noLoadingState: boolean, onLoad: () => void): void;
|
|
10
10
|
open(
|
|
11
11
|
fullScreen: boolean,
|
|
12
12
|
onSuccess: (result: UnsafeObject<LinkSuccess>) => void,
|