Can't share rich media posts using Share on LinkedIn Post API without User Authentication

66 views Asked by At

I have some data in an array on my React Website such that:

const books = [
  {
    title: "Book 1",
    amazon: "https://example.com",
    imageURL: "https://googleapis.com/Image1.jpg",
  },
  {
    title: "Book 2",
    amazon: "https://example.com",
    imageURL: "https://googleapis.com/Image2.jpg",
  }
];

When user clicks on a button, LinkedIn page should open up with all the post content already filled using above array. They just need to hit "Post" button.

Note: I also want the images to be explicitly present in the post content instead of there URLs. And the amazon links to be hyperlinks.

PS: No User Authentication is implemented on client website. An anonymous user can click on the Share button and be redirected to LinkedIn.

I tried using this:

const linkedInShareUrl = `https://www.linkedin.com/feed/?shareActive=true&text=${encodeURIComponent(postDescription)}`;

<a href={linkedInShareUrl} >Share</a>

But this only creates text posts. I want article post or something similar. Moreover, using offsite URL technique only allow sharing URL. I DO NOT need open graph meta tags as my content is dynamic and they are not separate pages.

Thanks.

0

There are 0 answers