#_aghor

1 messages · Page 1 of 1 (latest)

wicked vergeBOT
wintry brook
#

hello! how did you get to the 3DS authentication page? Can you share your code snippet?

modest isle
limpid furnace
modest isle
#

import React, { useEffect, useCallback } from 'react';
import { Linking } from 'react-native';
import { useStripe } from '@stripe/stripe-react-native';
import { RootApp } from './RootApp';

export default function MyApp() {
const { handleURLCallback } = useStripe();

const handleDeepLink = useCallback(
    async (url: string | null) => {
        if (url) {
            const stripeHandled = await handleURLCallback(url);
            console.log('Stripe handled deeplink: ', stripeHandled);
            if (stripeHandled) {

                // This was a Stripe URL - you can return or add extra handling here as you see fit
            } else {
                // This was NOT a Stripe URL – handle as you normally would
            }
        }
    },
    [handleURLCallback]
);

useEffect(() => {
    const getUrlAsync = async () => {
        const initialUrl = await Linking.getInitialURL();
        handleDeepLink(initialUrl);
    };

    getUrlAsync();

    const deepLinkListener = Linking.addEventListener(
        'url',
        (event: { url: string }) => {
            handleDeepLink(event.url);
        }
    );

    return () => deepLinkListener.remove();
}, [handleDeepLink]);

return (
    <RootApp />
);

}

#

this one right ?

#

Are there any additional steps for closing the the stripe in build webview ?

limpid furnace
modest isle
#

yes i have done this .

#

Do i need to handle redirects on the native side?

limpid furnace
modest isle
#

need to handle this on .mm file ?

limpid furnace
#

In general you don't. But I'd suggest you to check your AppDelegate and see if the function is overriden which could prevent the react-native Linking from working.

modest isle
#

likewise index and Myapp