Sadly?I am a newbie and that is my first time making an attempt out this part library.
Plainly the fields imageUrl, contentTitle, and contentDescription in ShareLinkContent ought to have been deprecated in API 2.9 primarily based on the feedback.
/**
Nonetheless, there’s an utility that configured these three fields three years in the past, and it may well show photographs and titles accurately when sharing web site hyperlinks within the feed.
This utility’s API model, which I discovered on builders.fb.com, is v17.0.
The code under is for the previous utility?
const getShareContent = ({
kind,
shareWaysType,
wechantShareContent,
facebookShareContent,
sharePreviewItem,
}: GetShareContentProps) => {
const { title, description, banner } = sharePreviewItem
if (!title || !description || !banner) return null
swap (shareWaysType) banner
return cloneWechatContent
case IShareWaysType.Fb:
const cloneFackbookContent = clone(facebookShareContent)
cloneFackbookContent.contentTitle = title
cloneFackbookContent.contentDescription = description
cloneFackbookContent.imageUrl = sharePreviewBanner
}
const facebookContent = getShareContent({
kind,
shareWaysType: IShareWaysType.Fb,
facebookShareContent: { ...fackbookShareContent, contentUrl },
sharePreviewItem,
}) as IShareLinkContent
if (!facebookContent) {
world?.toast?.open(translate("Group.ParameterError"))
shut?.()
return
}
ShareDialog.canShow(facebookContent)
.then((canShow: boolean) => {
if (canShow) {
ShareDialog.setMode("native")
return ShareDialog.present(facebookContent)
.then(() => {
shut?.()
onSuccess?.()
})
.catch(() => {
ShareDialog.setMode("automated")
if (kind === IShareType.NotCampaignShareNEarn) {
shut?.()
}
return ShareDialog.present(facebookContent).catch(error => {
world.toast?.open(`${translate("Group.SharingFailed")}?${error}`)
})
})
}
})
.lastly(() => {
onPress?.()
})
})
I wish to know what may very well be the attainable cause for this case.
Additionally, I wished to ask if there are any different fields or strategies for these deprecated fields? Or does this imply that we cannot be capable to connect photographs and titles when sharing web site hyperlinks sooner or later?
Thanks sincerely for any responses and ideas.
I’ve been making an attempt to make use of these three fields in an utility just lately, however with out success.