stripe-react-native
stripe-react-native copied to clipboard
[Android] 3DSecure confirmation screen closed if app is put in background
Hi all.
We currently have a bug happening on Android only.
After using confirmPaymentMethod on a payment, the 3DS screen is brought up. If instead of confirming / denying the payment on this screen we go into background and then bring the app back to active again, 3DS screen is just dismissed, so the app is stuck.
Obviously, at that moment Stripe payment is pending, but there's no way to bring up the payment screen again.
Even if there was, then the process would be repeated - if the user has to go to the bank's app in order to confirm the payment or whatever, the problem would come back and always be present.
Note: this does not happen on iOs.
To Reproduce Steps to reproduce the behaviour:
- Boot Android React Native app.
- Confirm payment with a 3DS card.
- When the
hooks.stripe.comscreen with the confirmation gets brought up, go into background. - Wait 2 seconds, open the app again.
- There you have a problem.
Expected behavior The expected behaviour would be the same as in iOs, for this screen not to be dismissed until the user does some action upon it.
Desktop (please complete the following information): OS: MacOs Big Sur 11.2.3 Browser: Chrome Version: 91.0.4472.77 (Official Build) (x86_64)
Smartphone (please complete the following information): Device: Honor 9 Lite Android version: 9
Additional context Stripe version: 0.1.4 React native version: 0.63.4
Thanks in advance!
@michelleb-stripe can you look into this?
React Native Android - The previous state of stripe payment screen not getting When app reopens click of app icon after minimize. when I am performing 3d secure payment using stripe payment screen.When I minimize the application in between this process and, reopen it by clicking on the app icon at that time I am not getting the previous state of stripe payment screen specific for android.
We are facing the same issue. By when we can expect this issue to be resolved? We are having a major bug because of this.
@aanalmehta-sa and @vipu-sa and @konstantinmv
In your manifest file you will have a single activity that has an intent filter of category: android.intent.category.LAUNCHER similar to:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Can you post the launchMode set on this activity? I believe this might be an issue with a launchMode = singleTask. If you use the defaultLaunch mode it might work. (See related issue: https://github.com/stripe/stripe-android/issues/3290).
closing due to inactivity, @aanalmehta-sa @vipu-sa @konstantinmv please reopen if above solution didn't work for you
closing due to inactivity, @aanalmehta-sa @vipu-sa @konstantinmv please reopen if above solution didn't work for you
@arekkubaczkowski I want to draw attention to https://github.com/stripe/stripe-android/issues/3290 also being closed pointing here, while the issue is still real for users like myself. Please reconsider reopening again.
Can you post the launchMode set on this activity? I believe this might be an issue with a launchMode = singleTask. If you use the defaultLaunch mode it might work. (See related issue: stripe/stripe-android#3290).
@michelleb-stripe I have this issue and I am using launchMode="singleTask". My current React Native app will not work if I change my launchMode, I am unable to use defaultLaunch. Can I provide you with some more information to help you debug this?
I'm having the same issue.
To recreate:
- Initiate payment
- Leave the app to check for a 3D secure SMS.
- Re-open the app by clicking on the app icon on the home screen
The payment errors out with "Failed to retrieve a PaymentSheetResult".
However, if you instead resume the app from the Android Task Switcher everything works as expected.
My manifest looks like:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" />
</intent-filter>
</activity>
I believe you're right that changing the singleTask launch mode will fix but this breaks deep linking for our RN Android app.
Would there be another work around?
Also facing this issue on Android only (same reproduction as @aaronSig), with the following environment :
- expo: 42.0.0
- react-native: 0.63.4
- @stripe/stripe-react-native: 0.1.4
However, resuming the app with the task switcher working as expected (tested in expo go and standalone build).
@arekkubaczkowski @michelleb-stripe is there anything new about this issue ?
@bob-user and @konstantinmv @aaronsig @cristeahub
3DS has a challenge response, so there is no way for us to re-create the webview as it would re-trigger the challenge, the user would reopen the banking app, and have the same problem. As long as the activity with the webview still exists in somewhere in the task stack it should be possible to reopen it.
When you relaunch your app in this way, is onNewIntent being called or is it creating a new instance?
@bob-user and @konstantinmv @aaronSig @cristeahub
In order for this to work I believe the StripeBrowserLauncherActivity (in the case of 3DS1) needs to be somewhere on the task stack after the launcher is pressed. However, when I created an application with the launchMode set to "singleTask" the StripeBrowserLauncherActivity is destroyed when clicking the launcher. (I verified this by registering an ActivityLifecycleCallbacks in an Application.onCreate method and logging all lifecycle events).
If you can instead use singleTop, and in the onNewIntent method you can check if it is a deep link and do any work you need there?
@michelleb-stripe I'm using the library in a managed expo app and I'm having trouble ejecting to access native code in order to test. Moreover, I'd like to keep up with the managed workflow so ejecting would only be a matter of debugging in my case. May this be resolved in an other way than accessing native code ?
Same problem with the following config :
- expo: 43.0.0
- react-native: 0.64.2
- @stripe/stripe-react-native: 0.2.2
shouldn't this issue be reopened ?
Same problem here with the following config (managed flow expo app):
- expo: 42.0.3
- react-native: 0.63.4
- @stripe/stripe-react-native: 0.1.4
Do you have any eta to solve this issue?
@acomley-stripe @trag-stripe Can you help engage with the expo team on this particular issue? I am happy to help jump in a conversation if needed.
I am experiencing same issue. If launchMode is not singleTask resuming app from app icon works. However we can not use other launch mode with react-native because it might introduce other issues. Also when returning back to the app from the app switcher works, but if app is resumed from the app icon the 3Ds confirmation view is no more.
I have implemented launchMode="singleTop" for now and it seems that this launchMode does resolve the bug. So far I did not notice that this launchMode would impact my app in any negative way. In the long run I think the issue should be resolved on singleTask mode as well
Same issue here. 3DS process is killed when we resume app from home with appIcon ... Any solution ?
Is there any update on this bug? Its causing a lot of issue for customers
any update ?
Looking into this, looks like an issue with the underlying android SDK, but could be wrong
Same issue here with the following steps:
- Add a payment method
- Goes to the bank app to authenticate and confirm
- Goes back to my app
- Goes back to my app by clicking on the app icon -> fails (and sometimes even no error is returned)
- Goes back to my app by using the app switcher -> works
Is there any update on this bug? We are facing the same issue for android users.
Same problem here on Android with the following config (managed flow expo app):
expo: 46.0.17 react-native: 0.69.6 @stripe/stripe-react-native: 0.13.1
Same issue with presentPaymentSheet
Hi, are you making any progress on this?
The native version of the 3DS2 auth screen is on the roadmap and is the long term fix for this issue, but we're still looking into proper workarounds in the meantime
Hi @charliecruzan-stripe, any news regarding this issue ? It has always been there for 2 years and no solution is provided.
This is an issue affecting the 3DS confirmation on Android and causes unintended cases about payment, it's a bit annoying.
A workaround would be appreciable in next release until we get a real fix.
Unfortunately we're still waiting on a fix in the stripe-android repo, I agree that this is pretty annoying and has been for a while. Let me check and see what the status of this fix is
Friendly ping :)
@charliecruzan-stripe any news ? (Can you give us the issue on stripe-android, thanks )