stripe-react-native
stripe-react-native copied to clipboard
Stripe re-direct not closing the in app browser in react-native 0.71
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:
- Open react native app using Stripe
- Open the payment sheet
- Click on any one of the payment methods
- The in-app browser will open, authorise the payment
- In-app browser doesn't close
Expected behavior In-app browser should close and return to the payment sheet with correct status
Screenshots
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.
I have the same problem on react-native 0.78.1 and 0.79.1. does anybody have a solution?
Facing the exact same issue on react-native 0.75.0
Me as well on React Native 0.77.2 and stripe 0.47.1
I was able to fix it by using
const { handleURLCallback } = useStripe();
Instead of
import { handleURLCallback } from '@stripe/stripe-react-native';
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';?