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'),
})
})
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.
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.
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.
If you get such error, update your google-services.json
file!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With