Code Monkey home page Code Monkey logo

react-native-plaid-link-sdk's Introduction

Plaid React Native SDK

version License

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.

For more information about Plaid Link check out our introduction documentation.

Plaid currently supports two versions of the Plaid React Native SDK v10.x and v11.x. You can find v10 on the master-v10 branch.

Features

The SDK provides:

  • A PlaidLink functional component.
  • A function to open Link.
  • A hook to handle onEvent callbacks.
  • A function to dismiss link on iOS.

Getting Started

Get started with our 📝 documentation and the 📱example project, or ↔️ Tiny Quickstart (React Native) which is an end to end example demonstrating a minimal integration with this SDK.

If you're unfamiliar with React Native we recommend starting with the environment setup instructions.

In your React Native project directory:

npm install --save react-native-plaid-link-sdk

iOS Setup

Add Plaid to your project’s Podfile as follows (likely located at ios/Podfile). The latest version is version.

Autolinking should install the CocoaPods dependencies for iOS project. If it fails you can run

cd ios && bundle install && bundle exec pod install

Android Setup

  • Android 5.0 (API level 21) and above.
    • Your compileSdkVersion must be 33.
  • Android gradle plugin 4.x and above.

AutoLinking should handle all of the Android setup.

React Native Setup

Version >= 11.6.0

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.

function createLinkTokenConfiguration(
  token: string,
  noLoadingState: boolean = false,
): LinkTokenConfiguration {
  return {
    token: token,
    // Hides native activity indicator if true.
    noLoadingState: noLoadingState,
  };
}

const tokenConfiguration = createLinkTokenConfiguration("#GENERATED_LINK_TOKEN#");
create(tokenConfiguration);

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.

function createLinkOpenProps(): LinkOpenProps {
  return {
    onSuccess: (success: LinkSuccess) => {
      // User was able to successfully link their account.
      console.log('Success: ', success);
    },
    onExit: (linkExit: LinkExit) => {
      // User exited Link session. There may or may not be an error depending on what occured.
      console.log('Exit: ', linkExit);
      dismissLink();
    },
    // MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
    iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
    logLevel: LinkLogLevel.ERROR,
  };
}

const openProps = createLinkOpenProps();
open(openProps);

Version < 11.6.0

In versions prior to 11.6.0, you can open a link by calling the openLink function.

// Create PlaidLinkProps from the provided token string.
function makeLinkTokenProps(token: string): PlaidLinkProps {
  return {
    tokenConfig: {
      token: token,
      logLevel: LinkLogLevel.ERROR,
      // Hides native activity indicator if true.
      noLoadingState: false, 
    },
    onSuccess: (success: LinkSuccess) => {
      // User was able to successfully link their account.
      console.log('Success: ', success); 
      success.metadata.accounts.forEach(it => console.log('accounts', it));
    },
    onExit: (linkExit: LinkExit) => {
      // User exited Link session. There may or may not be an error depending on what occured.
      console.log('Exit: ', linkExit);
      dismissLink();
    },
    // MODAL or FULL_SCREEEN presentation on iOS. Defaults to MODAL.
    iOSPresentationStyle: LinkIOSPresentationStyle.MODAL,
  };
}

const linkTokenProps = makeLinkTokenProps("#GENERATED_LINK_TOKEN#");
openLink(linkTokenProps);

OAuth requirements

⚠️ 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 January 1, 2024, to maintain support for Chase OAuth on iOS.

Android OAuth Requirements
Register your app package name
  1. Log into your Plaid Dashboard and navigate to the API page under the Developers tab.
  2. Next to Allowed Android package names click "Configure" then "Add New Android Package Name".
  3. Enter your package name, for example com.plaid.example.
  4. Click "Save Changes", you may be prompted to re-enter your password.
iOS OAuth Requirements

For iOS OAuth to work, specific requirements must be met.

  1. Redirect URIs must be registered, and set up as universal links.
  2. Your native iOS application, must be configured with your associated domain. See your iOS set up universal links for more information.
Link Token OAuth Requirements
  • On iOS you must configure your link_token with a 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.

  • On Android you must configure your link_token with an 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.

To receive onEvent callbacks:

The React Native Plaid module emits onEvent events throughout the account linking process — see details here. To receive these events in your React Native app, use the usePlaidEmitter hook in react functional components:

  usePlaidEmitter((event: LinkEvent) => {
    console.log(event)
  })

Upgrading

Plaid releases updates to the SDK approximately every few months. For the best user experience, we recommend using the latest version of the SDK.

Major SDK versions are released annually. SDK versions are supported for two years; with each major SDK release, Plaid will stop officially supporting any previous SDK versions that are more than two years old.

While these older versions are expected to continue to work without disruption, Plaid will not provide assistance with unsupported SDK versions.

Version compatibility

Plaid SDK Version Min React Native Version Android SDK Android Min Version Android Compile Version iOS SDK iOS Min Version Status
11.9.0 * [4.3.1+] 21 34 >=5.5.0 14.0 Active, supports Xcode 15.0.1
11.8.2 * [4.3.1+] 21 34 >=5.4.2 14.0 Active, supports Xcode 15.0.1
11.8.1 * [4.3.1+] 21 34 >=5.4.2 14.0 Active, supports Xcode 15.0.1
11.8.0 * [4.3.1+] 21 34 >=5.4.2 14.0 Active, supports Xcode 15.0.1
11.7.1 * [4.3.0+] 21 34 >=5.4.1 14.0 Active, supports Xcode 15.0.1
11.7.0 * [4.3.0+] 21 34 >=5.4.0 14.0 Active, supports Xcode 15.0.1
11.6.0 * [4.2.0+] 21 34 >=5.3.1 14.0 Active, supports Xcode 15.0.1
11.5.2 * [4.1.1+] 21 34 >=5.2.1 14.0 Active, supports Xcode 15.0.1
11.5.1 * [4.1.1+] 21 34 >=5.2.0 14.0 Active, supports Xcode 15.0.1
11.5.0 * [4.1.1+] 21 34 >=5.2.0 14.0 Active, supports Xcode 15.0.1
11.4.0 * [4.1.1+] 21 34 >=5.1.0 14.0 Active, supports Xcode 15.0.1
11.3.0 * [4.0.0+] 21 34 >=5.1.0 14.0 Active, supports Xcode 15.0.1
11.2.0 * [4.1.0+] 21 34 >=5.1.0 14.0 Deprecated
11.1.0 * [4.0.0+] 21 34 >=5.1.0 14.0 Active, supports Xcode 15.0.1
11.0.3 * [4.0.0+] 21 34 >=5.0.0 14.0 Active, supports Xcode 15.0.1
11.0.2 * [4.0.0+] 21 34 >=5.0.0 14.0 Active, supports Xcode 15.0.1
11.0.1 * [4.0.0+] 21 34 >=5.0.0 14.0 Active, supports Xcode 15.0.1
11.0.0 * [4.0.0+] 21 34 >=5.0.0 14.0 Active, supports Xcode 15.0.1
10.13.0 >= 0.66.0 [3.14.3+] 21 33 >=4.7.2 11.0 Active, supports Xcode 14
10.12.0 >= 0.66.0 [3.14.3+] 21 33 >=4.7.1 11.0 Active, supports Xcode 14
10.11.0 >= 0.66.0 [3.14.1+] 21 33 >=4.7.1 11.0 Active, supports Xcode 14
10.10.0 >= 0.66.0 [3.14.2+] 21 33 >=4.7.1 11.0 Deprecated
10.9.1 >= 0.66.0 [3.14.1+] 21 33 >=4.7.0 11.0 Active, supports Xcode 14
10.9.0 >= 0.66.0 [3.14.1+] 21 33 >=4.7.0 11.0 Active, supports Xcode 14
10.8.0 >= 0.66.0 [3.14.0+] 21 33 >=4.7.0 11.0 Active, supports Xcode 14
10.7.0 >= 0.66.0 [3.14.0+] 21 33 >=4.6.4 11.0 Active, supports Xcode 14
10.6.4 >= 0.66.0 [3.14.0+] 21 33 >=4.6.4 11.0 Active, supports Xcode 14
10.6.3 >= 0.66.0 [3.14.0+] 21 33 >=4.6.4 11.0 Active, supports Xcode 14
10.6.2 >= 0.66.0 [3.14.0+] 21 33 >=4.6.4 11.0 Deprecated, supports Xcode 14
10.6.0 >= 0.66.0 [3.14.0+] 21 33 >=4.6.4 11.0 Deprecated, supports Xcode 14
10.5.0 >= 0.66.0 [3.13.2+] 21 33 >=4.5.1 11.0 Deprecated, supports Xcode 14
10.4.0 >= 0.66.0 [3.13.2+] 21 33 >=4.4.0 11.0 Deprecated, supports Xcode 14
10.3.0 >= 0.66.0 [3.12.1+] 21 33 >=4.3.0 11.0 Deprecated, supports Xcode 14
10.2.0 >= 0.66.0 [3.12.0+] 21 33 >=4.3.0 11.0 Deprecated, supports Xcode 14
10.1.0 >= 0.66.0 [3.11.0+] 21 33 >=4.2.0 11.0 Deprecated, supports Xcode 14
10.0.0 >= 0.66.0 [3.10.1+] 21 33 >=4.1.0 11.0 Deprecated, supports Xcode 14
9.1.0 >= 0.65.3 [3.13.2+] 21 33 >=4.4.0 11.0 Deprecated, supports Xcode 14
9.0.1 >= 0.65.3 [3.10.1+] 21 33 >=4.1.0 11.0 Deprecated, supports Xcode 14
9.0.0 >= 0.65.3 [3.10.1+] 21 33 >=4.1.0 11.0 Deprecated, supports Xcode 14

Contributing

See the contributor guidelines to learn how to contribute to the repository.

react-native-plaid-link-sdk's People

Contributors

adamhari avatar afh avatar amytang0 avatar averyv avatar dependabot[bot] avatar dtroupe-plaid avatar dustinhorton avatar j-piasecki avatar jamesrperkins avatar jeroenmols avatar jhurray avatar jwoogerd avatar krisztiaan avatar melissaosullivan avatar otherchen avatar pabloearg avatar pbernasconi avatar pedroor avatar phoenixy1 avatar pladaub avatar prometheas avatar shaharyarmaroof avatar shaharyarmaroof-em avatar ssead avatar stoyand avatar taylor123 avatar vafada avatar willrstern avatar wolewicki avatar zsweigart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-plaid-link-sdk's Issues

'LinkKit/LinkKit.h' file not found (RNLinksdk.m)

After installing, I can no longer build due to:

RNLinksdk
  Lexical or Preprocessor Issue
    'LinkKit/LinkKit.h' file not found
      RNLinksdk.m

I see this specific error pointed out in the iOS SDK docs, but I'm not 100% it's applicable here, or what I might need to update the 'Framework Search Paths' to. I've tried basically every incantation of PROJECT_DIR and PODS_ROOT to no avail.

I think the file it's looking for exists at ios/Pods/Plaid/LinkKit.framework/Headers/LinkKit.h, but I'm not even sure that's actually the right file.

iOS: 'create' method not defined

I've installed the package, linked it and mounted a <PlaidLink {...bunchOfProps} /> as described in the readme. When I click on the rendered link I get the following error message:

console.error: "Unhandled promise rejection", TypeError: Cannot read property 'create' of undefined

perform$argument_0
    es6.promise.js:110:18
module.exports
    _perform.js:3:26
task.call$argument_1
    es6.promise.js:104:15
_allocateCallback$argument_0
    JSTimers.js:289:17
_callTimer
    JSTimers.js:146:6
_callImmediatesPass
    JSTimers.js:194:6
callImmediates
    JSTimers.js:458:11

My guess is it's this line: https://github.com/plaid/react-native-plaid-link-sdk/blob/master/PlaidLink.js#L27, which suggests it's not linking correctly.

In terms of steps taken to install, they were:

yarn add react-native-plaid-link-sdk

Added pod 'Plaid', '~> 1.1.27' to podfile

cd ios
pod install

Run script is already part of our build process.

Export `openLink` method

It would be nice if we could use the openLink method directly, instead of having to show the user a screen with a button to click on in order to actually open the link.

plaid-link-react-native npm package

I own the npm namespace plaid-link-react-native as I was planning to make a react native module but never got around to it.

Great to see effort being put into supporting React Native! Would y'all want owner ship of the package name so you have consistent naming for the link SDKs.

Android Application crashed if not providing com.plaid.link.public_key

Hello @wkiefer @zsweigart

I want to use different plaid key dynamic based on platform like sandbox or production, I already set key in <PlaidLink ... publicKey = "##YOUR PUBLIC KEY##" />.

When I removed bellow line from AndroidManifest.xml then application crashed on app launch

<meta-data android:name="com.plaid.link.public_key" android:value="YOUR KEY" />

Can you please help me

Causes activity callback issues for other packages

When 'react-native-plaid-link-sdk' is used in app, it causes activity callback to fail for other apps like 'react-native-image-picker'. 'react-native-image-picker' crashes the first time when you use it together with 'react-native-plaid-link-sdk', as its the first time when 'react-native-image-picker' asks for permissions from user, the callback for which it does not receive due to 'react-native-plaid-link-sdk' which makes the app crash.

Tested several times, once i remove 'react-native-plaid-link-sdk', everything starts working fine as expected. Please fix this, thanks.

Redirect Issue For Ireland Bank's

I'm trying to implement plaid for Ireland bank which is redirecting to browser but after successfully providing grant permission it's not redirecting back in-app [sandbox environment]

Results for iOS and Android differ

During selection:

  1. iOS shows all accounts
    image

  2. Android shows only depository types (checkings, savings)
    image

onSuccess:

  1. iOS
{
  "account": {
    "id": "<account ID>",
    "mask": "0000",
    "name": "Plaid Checking",
    "subtype": "checking",
    "type": "depository"
  },
  "account_id": "<account ID>",
  "accounts": [
    {
      "id": "<account ID>",
      "mask": "0000",
      "name": "Plaid Checking",
      "subtype": "checking",
      "type": "depository"
    }
  ],
  "institution": {
    "institution_id": "ins_6",
    "name": "US Bank"
  },
  "link_session_id": "<link session ID>",
  "public_token": "<public token>",
  "request_id": "<request ID>",
  "status": "connected"
}
  1. Android
{
  "link_connection_metadata": {
    "accounts": [[Object]],
    "institution_id": "ins_6",
    "institution_name": "US Bank",
    "link_session_id": "<link session ID>",
    "raw_data": {
      "account_id": "<account ID>",
      "account_mask": "0000",
      "account_name": "Plaid Checking",
      "account_subtype": "checking",
      "account_type": "depository",
      "accounts": "[{\"_id\":\"<account ID>\",\"balance\":{\"available\":100,\"currency\":\"USD\",\"current\":110,\"localized\":{\"available\":\"$100.00\",\"current\":\"$110.00\"}},\"meta\":{\"name\":\"Plaid Checking\",\"number\":\"0000\"},\"type\":\"depository\",\"subtype\":\"checking\"}]",
      "institution_id": "ins_6",
      "institution_name": "US Bank",
      "link_session_id": "<link session ID>",
      "public_token": "<public token>"
    }
  },
  "public_token": "<public token>"
}

<PlaidLink /> variable is the same as default configuration

Is this normal and should we just write code to query for platform?

iOS : Statusbar changed after plaid window closed

Hello,

We use default status bar and status bar showing properly till open plaid window.
After closing plaid window status bar not restoring as default status bar showing only white status bar with white font,so nothing showing in status bar

Inconsistent API for Link update

When opening Link in update mode:

in iOS, the property is token:

static NSString* const kRNLinkKitConfigPublicTokenKey = @"token";

in Android, the property is publicToken:

private const val PUBLIC_TOKEN = "publicToken"

Please make property consistent, i suggest using publicToken since its clearer and make sure not to make any breaking changes (maybe keep token for iOS to not break code which uses token already)

Plaid issue with React Native V0.59.9

Hi Team,

We are trying to integrate the plaid library with our react native project which is build on react
native version 0.59.9 and react js version 16.8.3. When we run the app then it is showing us the
error to increase the react native version to 0.61.5.
Will this library support older version of react native?
Can we use 0.59.9 version to integrate this library?

Pod install error

After following the readme instructions, I get the following error when running pod install:

[!] CocoaPods could not find compatible versions for pod "Plaid":
  In snapshot (Podfile.lock):
    Plaid (= 1.1.23)

  In Podfile:
    Plaid (~> 1.1.25)

    react-native-plaid-link-sdk (from `../node_modules/react-native-plaid-link-sdk`) was resolved to 1.0.2, which depends on
      Plaid

None of your spec sources contain a spec satisfying the dependencies: `Plaid (~> 1.1.25), Plaid (= 1.1.23), Plaid`.

My versions:

react-native: 0.61.4
cocoapods: 1.7.5

Android 10 crash when try to open plaid widget

given that:
OS: Android 10
device: Pixel 2

issue: crash on OS android 10 when try to open plaid widget;
Plaid SDK : 'com.plaid.link:sdk-core:0.3.2'
react-native-plaid-sdk : 2.0.4

it happens only on android 10, on Android 8 it works normally

react-native-info:
System:
OS: macOS 10.15.1
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 226.15 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.3.0 - /usr/local/bin/node
Yarn: 1.19.2 - /usr/local/bin/yarn
npm: 6.13.2 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 24, 27, 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.2
System Images: android-24 | Intel x86 Atom, android-24 | Intel x86 Atom_64, android-24 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
IDEs:
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: ^16.12.0 => 16.12.0
react-native: 0.61.4 => 0.61.4
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.2.2
react-native-vector-icons: 4.0.0

Stack trace:
android.security.KeyStore.getInvalidKeyException KeyStore.java:1309
android.security.KeyStore.getInvalidKeyException KeyStore.java:1402
android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit KeyStoreCryptoOperationUtils.java:54
android.security.keystore.KeyStoreCryptoOperationUtils.getExceptionForCipherInit KeyStoreCryptoOperationUtils.java:89
android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized AndroidKeyStoreCipherSpiBase.java:265
android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit AndroidKeyStoreCipherSpiBase.java:109
javax.crypto.Cipher.tryTransformWithProvider Cipher.java:2984
javax.crypto.Cipher.tryCombinations Cipher.java:2877
javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider Cipher.java:2796
javax.crypto.Cipher.chooseProvider Cipher.java:773
javax.crypto.Cipher.init Cipher.java:1143
javax.crypto.Cipher.init Cipher.java:1084
com.plaid.storage.PlaidKeystore.rsaDecrypt PlaidKeystore.kt:249
com.plaid.storage.PlaidKeystore.getSecretKey PlaidKeystore.kt:289
com.plaid.storage.PlaidKeystore.encrypt$storage_release PlaidKeystore.kt:95
com.plaid.storage.PlaidSecureStorage.saveData PlaidSecureStorage.kt:74
com.plaid.analytics.PlaidAnalyticsImpl.loadIdentity PlaidAnalyticsImpl.kt:158
com.plaid.analytics.PlaidAnalyticsImpl.getUserId PlaidAnalyticsImpl.kt:45
com.plaid.analytics.PlaidAnalyticsImpl.track PlaidAnalyticsImpl.kt:90
com.plaid.analytics.PlaidAnalyticsImpl.track PlaidAnalyticsImpl.kt:81
com.plaid.link.LinkActivity.onResume LinkActivity.kt:81
android.app.Instrumentation.callActivityOnResume Instrumentation.java:1453
android.app.Activity.performResume Activity.java:7962
android.app.ActivityThread.performResumeActivity ActivityThread.java:4195
android.app.ActivityThread.handleResumeActivity ActivityThread.java:4237
android.app.servertransaction.ResumeActivityItem.execute ResumeActivityItem.java:52
android.app.servertransaction.TransactionExecutor.executeLifecycleState TransactionExecutor.java:176
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:97
android.app.ActivityThread$H.handleMessage ActivityThread.java:2016
android.os.Handler.dispatchMessage Handler.java:107
android.os.Looper.loop Looper.java:214
android.app.ActivityThread.main ActivityThread.java:7356
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:492
com.android.internal.os.ZygoteInit.main ZygoteInit.java:930

additionally:
android.app.ActivityThread.performResumeActivity ActivityThread.java:4205
android.app.ActivityThread.handleResumeActivity ActivityThread.java:4237
android.app.servertransaction.ResumeActivityItem.execute ResumeActivityItem.java:52
android.app.servertransaction.TransactionExecutor.executeLifecycleState TransactionExecutor.java:176
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:97
android.app.ActivityThread$H.handleMessage ActivityThread.java:2016
android.os.Handler.dispatchMessage Handler.java:107
android.os.Looper.loop Looper.java:214
android.app.ActivityThread.main ActivityThread.java:7356
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:492
com.android.internal.os.ZygoteInit.main ZygoteInit.java:930

Expose DismissLinkViewController Method

EU oauth flow requires us to dismiss the Link view controller, and reinitialise with the oauthStateId. I could be missing something, but if you're using react navigation there doesn't seem to be a way to dismiss the plaid link view controller programatically.

Institutions are not coming

Institutions are not displaying while a search for a particular institution.
I searched with USAA or Suntrust but none is displayed.
I used the below props.
title="Add Account"
publicKey=''
env=''
product=[]
clientName=''"
webviewRedirectUri=""
language="en"
countryCodes=['US']
Is there any thing missed or need to add?

Callback arguments for onSuccess, onExit, onEvent

I am attempting to migrate from the prior react-native library to this one. Currently using 2.0.0.

Using the newly exposed openLink method, I've noticed the onSuccess and onExit callbacks don't conform to the documentation and the onEvent event is never called. I haven't tried launching plaid link via any other method.

  import { openLink } from 'react-native-plaid-link-sdk';

  const config = {
    // Most properties ommitted
    onExit: (arg1, arg2) => { console.log('DEBUG:onExit', { arg1, arg2 }); },
    onEvent: (arg1, arg2) => { console.log('DEBUG:onEvent', { arg1, arg2 }); },
    onSuccess: (arg1, arg2) => { console.log('DEBUG:onSuccess', { arg1, arg2 }); },
  };

  openLink(config);

When looking at the debugger, I get for onExit:
image

And for onSuccess:
image

The documentation (and prior react-native plaid library) shows:

onSuccess: function(public_token, metadata),
onExit: function(error, metadata),

However my output always has the metadata first and no second argument. The onSuccess does return the public_token, but it is part of an object with metadata as well.

Is there something I'm missing? Or has the callback signatures changed and there is a different documentation source to look at?

Appcenter: Failed to verify bitcode

I'm facing the following error on my build on Appcenter:

error: exportArchive: Failed to verify bitcode in LinkKit.framework/LinkKit:
error: Linker option verification failed for bundle /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/LinkKitjlVPaI/LinkKit.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.2.0)


Error Domain=IDEFoundationErrorDomain Code=1 "Failed to verify bitcode in LinkKit.framework/LinkKit:
error: Linker option verification failed for bundle /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/LinkKitjlVPaI/LinkKit.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.2.0)

" UserInfo={NSLocalizedDescription=Failed to verify bitcode in LinkKit.framework/LinkKit:
error: Linker option verification failed for bundle /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/LinkKitjlVPaI/LinkKit.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.2.0)

}

}

package version: "react-native-plaid-link-sdk": "2.0.4",

Link closes automatically

Hi!

I'm using openLink alone to open the link without showing any UI element before, but a strange behaviour is happening: if I don't wrap it in a setTimout it opens and it automatically closes right after. If I wrap it in a setTimout it works perfectly.

Here's how I'm doing it:

import { openLink } from 'react-native-plaid-link-sdk';
...
render () {
  return (
    <Component onPress={this.openPlaidLink}>
    ...
    </Component>
  );
}
...
openPlaidLink() {
    setTimeout(
      () =>
        openLink({
          clientName: 'foobar',
          env: get(plaid, 'environment'),
          onSuccess: response =>
            BankAccountUtils.onPlaidLinkSuccess(response, onFailed, onPending, onSuccess, navigation),
          product: ['auth', 'identity'],
          publicKey: get(plaid, 'publicKey')
        }),
      100
    );
}

Does somebody have any idea on why this might be happening?

Obs: I'm using v2.0.4

Thank you!

Data return on link success is inconsistent for both platform

the data in the onSuccess call is different for each platform

for iOS:

{
   public_token: string,
   account: {
    id: string | undefined | null;
    mask: string | undefined | null;
    name: string | undefined | null;
    type: string | undefined | null;
    subtype: string | undefined | null;
  };
  account_id: string | undefined | null;
  accounts: {
    id: string | undefined | null;
    mask: string | undefined | null;
    name: string | undefined | null;
    type: string | undefined | null;
    subtype: string | undefined | null;
  }[];
  institution: {
    institution_id: string;
    name: string;
  };
  link_session_id: string;
  request_id: string;
  status: string;
}

for Android

{
   public_token: string,
   link_connection_metadata: {
      institution_id: string,
      institution_name: string,
      accounts: {
         account_id: string | undefined | null;
         ...
  }[];
    link_session_id: string;
      ...
  }
}

Things to note.

  1. Android metadata is all under link_connection_metadata object while iOS has metadata spread out in the top-level object
  2. Android link_connection_metadata.accounts has no id prop but instead has account_id prop.
  3. Android has no institution object. instead its spread out to institution_id and institution_name compared to ios:
institution: {
    institution_id: string;
    name: string;
  };

2.0.4 - Android - selectAccount prop not working

For plaid link of product 'auth', passing prop 'selectAccount:true' does not cause plaid link to prompt user to select an account after logging into bank account. This prop does work as intended on iOS and javascript web client.

Preselect Bank

Is there a way to open Plaid Link Android with a preselected bank?

basically i want to skip the choose bank screen.

In the Plaid Swift module, that can be done by doing

PLKPlaidLinkViewController(institution: institutionType, ...);

Application crash after added plaid configuration in android

Application crash after added plaid configuration in android also not working any web api or http request

Please checked logcat logs
2019-12-24 19:52:33.861 17709-17890/com.anchorusd E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.anchorusd, PID: 17709 java.lang.NoSuchMethodError: No static method delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I in class Lokhttp3/internal/Util; or its super classes (declaration of 'okhttp3.internal.Util' appears in /data/app/com.anchorusd-S6BdJ2myTkrCxkc8Tmdafg==/base.apk:classes23.dex) at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.java:91) at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:74) at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:43) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:75) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184) at okhttp3.RealCall$AsyncCall.run(RealCall.kt:136) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

Android, link doesn't open Plaid

I'm running into issues v 2.0.3. The component link renders but when I click on link, the android app doesn't switch to a Plaid view of banks. In log cat I see error
Class not found when unmarshalling: com.plaid.linkbase.models.LinkConfiguration I'm assuming I have something configured wrong, but unsure of how to debug.

react-native-plaid-link-sdk Error (Android)

After installing and config to android , The app is not getting started

`

Could not determine the dependencies of task ':react-native-plaid-link-sdk:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':react-native-plaid-link-sdk:debugCompileClasspath'.
Could not find com.facebook.react:react-native:0.61.3.
Required by:
project :react-native-plaid-link-sdk

`

Link update mode?

I am working on implementing PlaidLink in React Native Android app. The new link case works fine for me but I am running into bugs with link update case.

Following tag results in regular new link mode. That is, I see the bank selector and I got a new public token once I complete the sign up.
<PlaidLink token={currentLink.publicToken}>...</PlaidLink>

I tried using publicToken as property name, as below
<PlaidLink publicToken={currentLink.publicToken}>...</PlaidLink>

That fails to open Plaid modal and my onExit handler is invoked with error
{"message":"The public token provided is not formatted correctly","class":"com.plaid.linkbase.models.PlaidLinkConfigurationInvalidTokenException"}
The publicToken is a string like "public-sandbox-98f6c2bd-b916-43ff-a153-xxxxxxxxxxxx" and it looks correctly formatted for me.

Version: 2.0.4
Platform: Android

Avoid hardcoding pubkey in AndroidManifest and load it from Js as for iOS?

For iOS, the configuration to open the PlaidLink can be loaded from Javascript code, while Android requires to add additional codes in AndroidManifest.
Even if I can use the manifestPlaceholders properties in build.gradle, we have the requirement to load the entire Plaid configuration dynamically from the server, therefore I'm looking for a way to avoid having the pubKey hardcoded in AndroidManifest.

Android crashes on launch

Currently attempting to use release 2.0.1. On iOS is working fine. I have followed the readme instructions for android, including adding the activity tags and meta-data to the AndroidManifest.xml file.. However app crashes at launch. With logcat, I see fatal error is related to

'java.lang.IllegalStateException: Please provide the public key in either Plaid.create() or in a manifest metadata tag with the android:name="com.plaid.link.public_key".

I'm confused because I am providing
<meta-data android:name="com.plaid.link.public_key" android:value="xxxxxxxxxxxx" />
in AndroidManifest.xml. Any help would be appreciated.

Android crash - Failure delivering result ResultInfo

This error is thrown when i sign in using react-native-google-signin. The thing is that the error happens on
com.plaid.PlaidModule.onActivityResult(PlaidModule.kt:222)
...
if (data.extras != null) {
result.putMap(DATA, Arguments.makeNativeMap(data.extras)) // <--- ??????
}
...
it looks that there is something weird around this line of code and i don't understand the purpose of this line.

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.eltonai, PID: 12251 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=-1, data=Intent { (has extras) }} to activity {com.eltonai/com.eltonai.MainActivity}: java.lang.IllegalArgumentException: Could not convert class com.google.android.gms.auth.api.signin.GoogleSignInAccount at android.app.ActivityThread.deliverResults(ActivityThread.java:4845) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: java.lang.IllegalArgumentException: Could not convert class com.google.android.gms.auth.api.signin.GoogleSignInAccount at com.facebook.react.bridge.Arguments.addEntry(Arguments.java:117) at com.facebook.react.bridge.Arguments.makeNativeMap(Arguments.java:147) at com.plaid.PlaidModule.onActivityResult(PlaidModule.kt:222) at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:277) at com.facebook.react.ReactInstanceManager.onActivityResult(ReactInstanceManager.java:704) at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:129) at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:75) at android.app.Activity.dispatchActivityResult(Activity.java:8110) at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)

Application crash in android when system back button

Hello,

Application crash in android when press system back button after open plaid window

2019-12-26 12:34:04.497 7040-7040/com.rnplaidexample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.rnplaidexample, PID: 7040 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=101, result=0, data=null} to activity {com.rnplaidexample/com.rnplaidexample.MainActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter data at android.app.ActivityThread.deliverResults(ActivityThread.java:4323) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4366) at android.app.ActivityThread.-wrap19(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6540) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter data at com.plaid.PlaidModule.onActivityResult(Unknown Source:7) at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:275) at com.facebook.react.ReactInstanceManager.onActivityResult(ReactInstanceManager.java:703) at com.facebook.react.ReactDelegate.onActivityResult(ReactDelegate.java:89) at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:110) at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:67) at android.app.Activity.dispatchActivityResult(Activity.java:7237) at android.app.ActivityThread.deliverResults(ActivityThread.java:4319) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4366)  at android.app.ActivityThread.-wrap19(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6540)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 

You can find sample example code here.

https://github.com/kanji-keraliya/RNPlaidExample/tree/0e6d833ff3928ff4d0dcfad646ca647f8fb25f33

Can anyone help me to integrate official plaid in react native application.

Thank

(iOS 13) onExit & onSuccess not called if modal is dismissed by swiping

By default on iOS 13, the Plaid Link view controller is presented with a modalPresentationStyle of UIModalPresentationPageSheet. This is a new default in iOS 13 and causes the view controller to be able to be swiped interactively to dismiss.

This is fine except when the user swipes to dismiss the modal (instead of explicitly pressing the "X" and "Yes, exit") the onExit callback is never called.

The same thing happens with the onSuccess callback at the end of the flow.

If the user swipes to dismiss this modal (instead of pressing "Finish"), the onSuccess callback is never called.

Workaround

The current workaround I'm using on my fork is to set modalInPresentation = YES on linkViewController. This prevents the view controller from being dismissed by swiping. I don't think this is a good permanent solution though, because ideally you would still be able to swipe to dismiss with the callbacks firing as expected.

'TypeError: null is not an object' when clicking 'Add Account'

I've followed the instructions in the README for ios. When I click Add Account in the iOS simulator, no Plaid dialog pops up. Instead I get a warning in the UI and the following error in my Expo terminal:

[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNLinksdk.create')]
- node_modules/react-native-plaid-link-sdk/PlaidLink.js:28:28 in openLink$
- node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- ... 36 more stack frames from framework internals

The UI warning looks like this:

Screen Shot 2019-12-19 at 8 49 44 PM

I'm using version 2.0.4 with react-native version 35.0.0 (Expo's fork).

This is the JSX code I'm using (with the correct variables):

<PlaidLink
  publicKey="<my-public-key>"
  clientName="<my-client-name>"
  env="sandbox"
  product={["transactions"]}
  webviewRedirectUri = "<my-app-name>://redirect"
  onSuccess={this.handleOnSuccess}
  onExit={this.handleOnExit}>
    <Text>Add Account</Text>
</PlaidLink>

EDIT: I manually linked the SDK via npx react-native link react-native-plaid-link-sdk and am using expo start with xCode to run the app. I think I've done all the right setup here but I am new to React Native.

Any ideas? Thanks!

PlaidLink component not displaying

I've followed the documentation and have an iOS simulator running with Expo. The PlaidLink component is not displaying despite other components on the same screen being displayed.

I see no errors or warnings. Using react-devtools, I see the PlaidLink component in the hierarchy along with its various child components, eg TouchableOpacity.

I'm using version 2.0.0.

Any ideas why nothing is being displayed? Thanks!

Android App Crashes on load

I am using Plaid link SDK version "react-native-plaid-link-sdk": "^3.0.1" and I followed the Android linking steps as mentioned in the repo installation steps. Now when I launch my app, it crashes instantaneously.

The following error is shown in the stacktrace:

java.lang.NoSuchMethodError No virtual method toString(Z)Ljava/lang/String; in class Lokhttp3/Cookie; or its super classes (declaration of 'okhttp3.Cookie' appears in /data/app/myapp-y9h-TDL2rArQrrFfq8GM-A==/base.apk!classes4.dex) 
    JavaNetCookieJar.java:45 okhttp3.JavaNetCookieJar.saveFromResponse
    ReactCookieJarContainer.java:42 com.facebook.react.modules.network.ReactCookieJarContainer.saveFromResponse
    HttpHeaders.kt:207 okhttp3.internal.http.HttpHeaders.receiveHeaders
    BridgeInterceptor.kt:86 okhttp3.internal.http.BridgeInterceptor.intercept
    RealInterceptorChain.kt:112 okhttp3.internal.http.RealInterceptorChain.proceed
    RetryAndFollowUpInterceptor.kt:71 okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept
    RealInterceptorChain.kt:112 okhttp3.internal.http.RealInterceptorChain.proceed
    RealInterceptorChain.kt:87 okhttp3.internal.http.RealInterceptorChain.proceed
    RealCall.kt:184 okhttp3.RealCall.getResponseWithInterceptorChain
    RealCall.kt:136 okhttp3.RealCall$AsyncCall.run
    ThreadPoolExecutor.java:1167 java.util.concurrent.ThreadPoolExecutor.runWorker
    ThreadPoolExecutor.java:641 java.util.concurrent.ThreadPoolExecutor$Worker.run
    Thread.java:764 java.lang.Thread.run

If I remove these changes the app runs on android without crash, but this means Plaid will not work on Android.
For iOS it is working seamlessly. Any idea what is wrong here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.