Short dynamic link not generated in react native

Viewed 718

I am not able to generate short dynamic link for sharing. We are using firebase dynamic link share.At the time of link generation got following error

[dynamicLinks/build-failed] The operation couldn’t be completed. Cannot shorten a short Dynamic Link: XXXX [https://firebase.google.com/docs/dynamic-links/rest#create_a_short_link_from_parameters]

Here is my code

import dynamicLinks from '@react-native-firebase/dynamic-links';

export async function buildDynamicLink(Id) {


    try {

        let shortLink = await dynamicLinks().buildShortLink({
            link: 'https://www.xyx.com?id=' + (Id),
            domainUriPrefix: 'https://xyz.page.link',
            social:{
                title: 'xxx',
                descriptionText: 'xxx'
            },
            ios:{
                bundleId : 'com.xxx.application'
            },
            android: {
                packageName: 'com.xxx.application'
            }
        },"SHORT")
        return shortLink
    } catch (error) {
        console.log(error)
    }
}
1 Answers

I just tested your code in our app where we use dynamiclinks 7.5.13 and it worked perfectly fine.

How long is the link you are trying to shorten? Maybe try with a different link length to exclude that as the cause of the problem.

Related