Comments (10)
Actually nvm that did not fix it. Adding useWebKit
to the webview created by react-native-plaid-link
did however.
from react-native-plaid-link.
@catalinmiron
I created pull request to fix this.
Thanks again @tonyxiao
from react-native-plaid-link.
I wasn't able to get things working on the latest version of React Native, even with this fix. After many hours of troubleshooting, I ended up mostly rewriting the component and finally getting it working. I'm going to leave my work here just in case it's useful for anyone else in the same situation!
import React from "react";
import { WebView, WebViewIOSLoadRequestEvent, WebViewProperties } from "react-native";
import parse from "url-parse";
const encodeParams = (params: Object) =>
Object.entries(params)
.filter(([k, v]) => v != null)
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
.join("&");
interface Props extends WebViewProperties {
publicKey: string;
env: "development" | "sandbox" | "production";
product: string;
clientName?: string;
webhook?: string;
selectAccount?: boolean;
onSuccess?: (e: any) => void;
onExit?: (e: any) => void;
}
export default class PlaidAuthenticator extends React.Component<Props> {
static defaultProps = {
selectAccount: false
};
handleLoadRequest = (e: WebViewIOSLoadRequestEvent) => {
if (e.url.includes("postMessage")) {
return false;
}
if (e.url.startsWith("plaidlink")) {
const parsed = parse(e.url, true);
if (parsed.host === "connected") {
this.props.onSuccess && this.props.onSuccess(parsed.query);
} else if (parsed.query && parsed.query.event_name === "EXIT") {
this.props.onExit && this.props.onExit(parsed.query);
}
return false;
}
return true;
};
render() {
const {
publicKey,
selectAccount,
env,
product,
clientName,
style,
webhook,
onSuccess,
onExit,
...rest
} = this.props;
const params = {
key: publicKey,
apiVersion: "v2",
env,
product,
clientName,
isWebview: true,
isMobile: true,
selectAccount,
webhook
};
const uri = `https://cdn.plaid.com/link/v2/stable/link.html?${encodeParams(params)}`;
return (
<WebView
{...rest}
source={{ uri }}
onShouldStartLoadWithRequest={this.handleLoadRequest}
originWhitelist={["plaidlink://", "https://"]}
/>
);
}
}
from react-native-plaid-link.
Seeing the same issue over here as well :(
from react-native-plaid-link.
@nikolal I was able to fix it by passing additional param selectAccount={false}
from react-native-plaid-link.
This doesn't fix the issue for me.
I just copy pasted code from this lib and set useWebKit
to webView.
Do you maybe have some example I could use?
from react-native-plaid-link.
It works.
I forgot to change import from the installed lib to the copied code.
Thanks a lot.
from react-native-plaid-link.
Has this fix been published to NPM yet?
from react-native-plaid-link.
Not merged yet.
You can just download this lib to your project ( only 2 files ), add useWebKit until it's merged.
from react-native-plaid-link.
@nikolal @bfine9618 the PR was merged and I've published a new version 1.3.8 🎉. Thanks everyone!
from react-native-plaid-link.
Related Issues (20)
- Update README to include selectAccount parameter
- ACH numbers not being returned
- On Dismissing plaid on mobile, it ends up with white screen HOT 5
- When entering user and pass, get AccessDenied HOT 1
- Unhandled Promise Rejection leading to no data returned
- Plans to support Link's update mode? HOT 7
- Distinguish between close and continue event
- development environment throwing me an internal service error
- Google recaptcha puzzle was hidden HOT 1
- Metadata doesn't include public_token HOT 2
- Apple will stop accepting submissions of apps that use uiwebview apis in react native HOT 4
- Accessing the close button within the web view
- Future of this library HOT 1
- App crash when following links in Plaid End User Privacy Policy HOT 1
- Products prop taking an array
- Animation between pages
- React Native Plaid
- Error: crypto.getRandomValue() not supported
- Plaid Link OAuth redirect flow support HOT 2
- SyntaxError: JSON Parse error: Unexpected identifier "setImmediate$0" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-plaid-link.