Share links on Linkedin not works

109 Views Asked by At

We are using share links with preview using below code

const onLinkedInShare = () => {
    setLinkedInModalOpen(false);
    const shareUrl = window.location.href;
    window.open(
        `https://www.linkedin.com/sharing/share-offsite?url=${shareUrl}`,
        '_blank',
        'width=550,height=431,location=no,menubar=no,scrollbars=no,status=no,toolbar=no',
    )
};

We are getting something went wrong page when previewing.

enter image description here

Also we are adding OG tags for preview supports. But still we having issue in share links in Linkedin.

<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:site_name" content="StageClip" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content={canonicalUrl} />
<meta property="og:image" content={clip?.thumbnail} />
<meta property="og:image:secure_url" content={clip?.thumbnail} />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content={clip?.width?.toString()} />
<meta property="og:image:height" content={clip?.height?.toString()} />
<meta property="og:image:alt" content={title} />
<meta property="og:video" content={clip?.uri} />
<meta property="og:video:secure_url" content={clip?.uri} />
<meta property="og:video:type" content="video/mp4" />
<meta property="og:video:width" content={clip?.width?.toString()} />
<meta property="og:video:height" content={clip?.height?.toString()} />

<meta property="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content={canonicalUrl} />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={clip?.thumbnail} />

Tried on linkedin post inspector as well, it returns 500 with saying 'We encountered a server error while trying to inspect the URL'.

0

There are 0 best solutions below