catalinmiron / react-native-plaid-link

React Native Plaid authenticator
122 stars 56 forks source link

Reset Password throws error #13

Open mc13an opened 6 years ago

mc13an commented 6 years ago

If you select Reset Password after you select your bank the web view thows:

screen shot 2018-06-05 at 10 12 17 am
ghost commented 6 years ago

I have the same problem.

ghost commented 6 years ago

I am find one solution:

<PlaidAuth
    onMessage={ scope.onMessage }
    publicKey={ config.key }
    env={ config.env }
    product={ config.product }
    clientName="CoinVest"
    onShouldStartLoadWithRequest={ (request) => this.onShouldStartLoadWithRequest(request) } // add this line
/>

onShouldStartLoadWithRequest = (request) => {
    if (request.navigationType != undefined && request.navigationType != 'other') {
        // If user click in reset password, the webview return nothing, and react open the 
        // uri in default device browser, "Import Linking of react-native"
        Linking.canOpenURL(request.url).then(supported => {
            if (supported) {
                Linking.openURL(request.url);
            }
            else {
                console.log("Don't know how to open URI: " + request.url);
            }
        });
    }
    else
        return true;
}
C-Birdwell commented 5 years ago

I am find one solution:

<PlaidAuth
    onMessage={ scope.onMessage }
    publicKey={ config.key }
    env={ config.env }
    product={ config.product }
    clientName="CoinVest"
    onShouldStartLoadWithRequest={ (request) => this.onShouldStartLoadWithRequest(request) } // add this line
/>

onShouldStartLoadWithRequest = (request) => {
    if (request.navigationType != undefined && request.navigationType != 'other') {
        // If user click in reset password, the webview return nothing, and react open the 
        // uri in default device browser, "Import Linking of react-native"
        Linking.canOpenURL(request.url).then(supported => {
            if (supported) {
                Linking.openURL(request.url);
            }
            else {
                console.log("Don't know how to open URI: " + request.url);
            }
        });
    }
    else
        return true;
}

Confirmed working in XCode in a sandbox enviroment.

Thanks so much!