我无法生成用于共享的短动态链接。我们正在使用 firebase 动态链接共享。在链接生成时出现以下错误
[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]
这是我的代码
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)
}
}
最佳答案
我刚刚在我们使用 dynamiclinks 7.5.13 的应用程序中测试了您的代码,它运行良好。
您要缩短的链接有多长?也许尝试使用不同的链接长度来排除它作为问题的原因。
https://stackoverflow.com/questions/65037302/