DeepLinking React Native App with firebase deeplink

Viewed 80

i'm trying to implement deeplink functionality in react native app using firebase deeplink, functionality is similar like sharing functionality of flipkart and amazon app, when we share a product to social media it should redirect to product specific page

i have implemented npm i react-native-share for sharing link with some description and images

code snippet for sharing

       url: "https://stepout.page.link/activity_id/?id=" + this.state.activityType_id,
       title: this.state.activityTypeName,
       message: "Test Data",
       subject: "Share Link", //  for email
       social: Share.Social.FACEBOOK})
              .then(result => console.log("Share Insta=>", result))
              .catch(errorMsg => console.log("Error Share Insta=>", errorMsg))
}}

after sharing link to insta when i user clicks on it it will give popup which displays browser and myApp

when i clicked on myApp then i'm getting null

Linking.addEventListener('url', this.handleOpenURL);
         Linking.getInitialURL().then((url) => {
             console.log('initial url:' + url)
         })

but when i tried with branch i'm getting some value only issue is i have to click on app only, if i'm comming from browser it shows www.google.com

branch.subscribe(({ error, params }) => {
            if (error) {
                console.error('Error from Branch: ' + error)
                return
            }

kindly help how to handle dynamic link when its clicked from other app, And guide me is there any issue while generating dynamic link
            console.log("Params-->", params);
        })
0 Answers
Related