-1

I am using Firebase Dynamic link I am successfully creating a link but when i am testing it the link is opening but I cannot get the dynamic link.

const HandleDeepLink = () => {
const navigation = useNavigation();

const handleDynamicLink = link => {
Handle dynamic link inside your own application
console.log('link', link)
>     };

useEffect(() => {
const unsubscribe = dynamicLinks().onLink(handleDynamicLink);
When the component is unmounted, remove the listener
return () => unsubscribe();
[]);

return null;
>   }

useEffect(() => {
dynamicLinks()
>       .getInitialLink()
>       .then(link => {
console.log('link', link)
>       });
[]);

here is the code.

I tried different listener but nothings work.

1 Answer 1

1

I've got the same issue when testing with emulator/simulator, I have to work around with Linking:

import DeviceInfo from 'react-native-device-info';
...

useEffect(() => {
    let linkingSubscription: EmitterSubscription;
    if (__DEV__ && DeviceInfo.isEmulatorSync()) {
       linkingSubscription = Linking.addEventListener('url', ({ url }) => {
           console.log('Linking eventListener', url);
          // do something
       });
    }
    return () => {
       linkingSubscription?.remove();
    };
}, []);

Please be aware that the Dynamic Links will be shut down in 2025-08-25.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.