Skip to content

oAuth flow restarting RN app on Android #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
djMax opened this issue Aug 20, 2022 · 3 comments
Closed

oAuth flow restarting RN app on Android #503

djMax opened this issue Aug 20, 2022 · 3 comments

Comments

@djMax
Copy link

djMax commented Aug 20, 2022

The problem

When using BofA in stage on android, after completing the browser flow it comes back to the RN app, but the app is forced to reload from scratch and bad things (tm) happen. We can, in theory, try to make the plaid session work across app restarts, but (a) I don't know if the Plaid SDK will handle that and (b) it's going to be a pile of work for us to handle that too.

I think it could be related to react-native-splash-screen, but I am not clear on why it is restarting the intent.

crazycodeboy/react-native-splash-screen#289

Environment

Plaid Link React Native 8.0.0
ReactNative Version 0.67.4
Occurs on Android yes
Android OS Version 31
Android Devices/Emulators Samsung Fold
Occurs on iOS no

Steps to Reproduce

Use link token to begin a Plaid session, select BofA, go out to browser and complete flow.

Expected Result

Resume app/intent/activity that was running when the user went to the browser.

@djMax
Copy link
Author

djMax commented Aug 20, 2022

I know a tiny bit more now. In normal cases, when our app is running and a deep link is opened, onNewIntent is called both on the splash activity and the main activity, but the app functions as normal and does not reload. BUT, when the Plaid Link SDK has been started and our app is backgrounded, when it comes back (regardless of whether that is after a completed oauth flow or not), our activity gets destroyed, and thus when the app comes back, onCreate is called, and a new app instance is required. This is not what we want, and I'm not entirely sure why the Plaid SDK causes it, but it doesn't seem like it's our bug. It's either "by design" for some reason, or a Plaid Android SDK issue?

@djMax
Copy link
Author

djMax commented Aug 21, 2022

And now more - I thought I was passing both redirect_uri and android_package_name, but it seems only redirect_uri was making it. It's a very strange failure mode, but I think the problem is I'm not supposed to pass redirect_uri at all.

@djMax djMax closed this as completed Aug 21, 2022
@shriyash-joinroy
Copy link

Can you guide more on this?
Did the issue got solved on app restart?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants