Error: 400: Your project does not own Dynamic Links domain
Asked Answered
E

6

7

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'),
        })
      }) 
Endomorph answered 18/4, 2018 at 15:40 Comment(6)
This github issue seems to point to an application ID mismatch: github.com/firebase/quickstart-ios/issues/393Rollie
@Cory I saw this, but my app has the same application ID, which I'm using in my appEndomorph
@Endomorph Did you ever solve this?Lyallpur
@Lyallpur but I think that problem can be in google-services.json file, I would recommend you to update it, and see if it will solve the problem!Endomorph
Yes it was that! Thanks :)Lyallpur
@Lyallpur awesome, happy that it works! Please vote for the answer!Endomorph
E
8

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

Endomorph answered 20/9, 2018 at 9:14 Comment(1)
how to update this file ? I only download it from Firebase there is no option to update itBoltrope
M
1

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.

Mansell answered 1/7, 2022 at 5:47 Comment(0)
C
1

Please update your link URL

https://yourDomain?WXYZ?d=1 

To

https://yourDomain/WXYZ?d=1 

As per allowed URL 
https://support.google.com/firebase/answer/9021429
Cleavers answered 18/9, 2023 at 8:28 Comment(0)
B
0
Try this method,

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

async function generateLink() {
const link = await dynamicLinks().buildLink({
link: 'valid domain url',
domainUriPrefix: 'valid domain url',
analytics: {
  content: 'your data',
},
});
console.log(link)
}
Bryanbryana answered 24/5, 2022 at 12:48 Comment(0)
W
-1

when you get this error that means you did not add the dynamic link domain as a formate of the firebase link.

you must follow this formate: <app_name.page.link>

In android/app/src/main/AndroidManifest.xml add within the activity:

<!-- Deep linking -->
<meta-data android:name='flutter _deeplinking_enabled' 
android:value="true" />
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="<app_name.page.link>" />
<data android:scheme="https" />
</intent-filter>

and added at the same with that formate <app_name.page.link> in dynamic link code.

Weise answered 7/1, 2022 at 12:34 Comment(0)
J
-3

You might not have done npm install if your google-services.json is already updated

Juvenescent answered 4/2, 2021 at 6:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.