Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: 400: Your project does not own Dynamic Links domain

I'm using react-native-firebase to create dynamic links, when I create standard link everything works fine, but when I'm creating short link, it gives an error: "Error: 400: Your project does not own Dynamic Links domain". Any ideas how is possible to fix that?

UPDATE: problem occurs only in Android, in IOS works fine

Code for the creating short dynamic link:

onClickShare= () => {
const link =
    new firebase.links.DynamicLink(redirectLink , Config.FIREBASE_CONFIG.dynamicLink)
      .android.setPackageName(Config.ANDROID_PACKAGE_NAME)
      .ios.setBundleId(Config.IOS_BUNDLE_ID)
      .ios.setAppStoreId(Config.IOS_APP_STORE_ID)
      .social.setDescriptionText(description)
      .social.setTitle(this.props.event.title)

      firebase.links()
      .createShortDynamicLink(link, 'SHORT')
      .then((url) => {
      Share.share({
        message: _('shareLinkMessage') + " " + url,
        title: _('shareLinkTitle'),
       }, {
        // Android only:
        dialogTitle:  _('shareLinkAndroid'),
        })
      }) 
like image 954
Lucky_girl Avatar asked Apr 18 '18 15:04

Lucky_girl


People also ask

How to add URL prefix Firebase?

Open the Dynamic Links page of the Firebase console. If you haven't used Dynamic Links before, click Get Started. Otherwise, click Add URL prefix from the drop-down menu. Then, complete the setup wizard, specifying the domain and path prefix you want to use when prompted.

What is Dynamic Link in firebase?

Dynamic Links are smart URLs that allow you to send existing and potential users to any location within your iOS or Android app. They survive the app install process, so even new users see the content they're looking for when they open the app for the first time.

What is Page Link domain?

A “linking domain” is the main address (often where the homepage lives) of a website that has a page (or more) which links to your website. People who are working on SEO for their website are rightly concerned with the quality of the websites that link to theirs.


2 Answers

If you get such error, update your google-services.json file!

like image 74
Lucky_girl Avatar answered Oct 09 '22 09:10

Lucky_girl


In my case (using Flutter), I was getting this error because of incorrect "uriPrefix" parameter while in DynamicLinkParameters object params:

final DynamicLinkParameters parameters = DynamicLinkParameters(
      uriPrefix: your_page_link, //<-- this should be same as in your Firebase project
      link: Uri.parse(....),
      androidParameters: AndroidParameters(
        ....
      ),
      iosParameters: IOSParameters(
        ....
      ),
    ); 

Please make sure if you have uriPrefix value set properly.

like image 44
user2335639 Avatar answered Oct 09 '22 07:10

user2335639