stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

Stripe re-direct not closing the in app browser in react-native 0.71

Open abhishekashyap opened this issue 10 months ago • 2 comments

Describe the bug I'm testing out more payment methods for Stripe following this guide. This was not working in my existing app which is using React Native 0.71. I created two standalone apps with same deep link configuration and similar URL scheme. The difference between these apps being the React Native version. One using 0.71 while the other using 0.76. In the app that was using RN 0.76, the flow was working correctly, while in RN 0.71 version the in app browser was never getting closed.

To Reproduce Steps to reproduce the behavior:

  1. Open react native app using Stripe
  2. Open the payment sheet
  3. Click on any one of the payment methods
  4. The in-app browser will open, authorise the payment
  5. In-app browser doesn't close

Expected behavior In-app browser should close and return to the payment sheet with correct status

Screenshots Screenshot 2025-01-06 at 8 46 22 PM

Smartphone (please complete the following information):

  • Device: iPhone 16 Pro
  • OS: iOS 18.2
  • Browser: stock browser, safari
  • Version: @stripe/stripe-react-native 0.40.0

Additional context If I manually close the in-app browser the Stripe payment displays the status correctly.

abhishekashyap avatar Jan 06 '25 15:01 abhishekashyap

I have the same problem on react-native 0.78.1 and 0.79.1. does anybody have a solution?

remllov91 avatar Apr 28 '25 09:04 remllov91

Facing the exact same issue on react-native 0.75.0

Dr-Drake avatar Jun 13 '25 19:06 Dr-Drake

Me as well on React Native 0.77.2 and stripe 0.47.1

asapMaki avatar Jul 15 '25 08:07 asapMaki

I was able to fix it by using const { handleURLCallback } = useStripe();

Instead of import { handleURLCallback } from '@stripe/stripe-react-native';

asapMaki avatar Jul 15 '25 08:07 asapMaki

Thanks for that, @asapMaki! I'm trying to debug the issue now: @abhishekashyap, can you confirm whether you're using const { handleURLCallback } = useStripe(); or import { handleURLCallback } from '@stripe/stripe-react-native';?

davidme-stripe avatar Jul 24 '25 02:07 davidme-stripe