nygardk / react-share

Social media share buttons and share counts for React
MIT License
2.62k stars 432 forks source link

about og:image #125

Closed mirik999 closed 6 years ago

mirik999 commented 6 years ago

Hi people, what is wrong in my code? image and title doesnt shows `

    <FacebookShareButton url={`itechs.info${url}`}>
<div className="share-icon">
    <img src={require('../../../lib/img/fb-icon.png')} alt="facebook-share-icon" />
</div>
</FacebookShareButton>
   </div>`
aautio commented 6 years ago

I assume your problem is not related to react-share. If you manually share your page, the image and title are also missing? This might happen if you have not declared og namespace.

Use <html prefix="og: http://ogp.me/ns#"> as your root element and the image + content should become visible in the share dialog.

mirik999 commented 6 years ago

root element you mean component ? or index.html ? in index.html i tired but no result.

aautio commented 6 years ago

When the Facebook bot crawls your site it should see the definitions. Depending on your setup it might be your index.html.

Have you tried https://developers.facebook.com/tools/debug/ to debug your page? Can you share a link to it?

aautio commented 6 years ago

Closing after 2 weeks of inactivity. @mirik999 please reopen if necessary.

mirik999 commented 6 years ago

Sory for a long time , aautio, i cant set. (( i attach 3 screenshot , maybe i did mistake. screenshot_4 screenshot_2 screenshot_3