Untitled

 avatar
unknown
plain_text
a month ago
757 B
2
Indexable
import { Linking } from 'react-native';
import { useEffect } from 'react';

const App = () => {
    useEffect(() => {
        const handleUrl = (event) => {
            const { url } = event;
            console.log('Redirected URL:', url);

            // Extract tokens or handle the redirect logic here
            if (url.startsWith('vunoride://open')) {
                // Handle successful login
                console.log('Google Sign-In success, redirected to app');
            }
        };

        // Add listener for incoming links
        const linkingListener = Linking.addEventListener('url', handleUrl);

        // Cleanup listener on unmount
        return () => linkingListener.remove();
    }, []);

    return <YourAppComponent />;
};
Leave a Comment