简体   繁体   中英

Share a image on Facebook with facebook ID

I wish that the users of my website to share pictures on their walls, with the Open Graph. In the URL of the image to share, I include the Facebook ID person, which gives me:

<meta property="og:image" content="http://mywebsite.com/text_ID.jpg" />

It works. The image is generated, with ID, but when I test on the Facebook Object Debugger:

<meta property="og:image" content="http://mywebsite.com/text_.jpg" />

ID disappeared. I do not understand why. Someone would it be what it is due? Thanks you in advance for your response.

I think this is because the Facebook Object Debugger is not logged to your app when it scrape the page, so there is no user ID.

A solution would be to get the user ID from the URL.

To be more clear on @Yassine' answer,

You're generating an image for a specific user which is surely a dynamic way of getting ID and placing the respective ID in the OG meta tag.

Facebook object debugger is no way going to recognize the ID from the meta tag because it is not logged into your app which means your app doesn't have the ID and thus no ID is set in the meta tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM