简体   繁体   English

使用Facebook ID在Facebook上共享图像

[英]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: 在要共享的图像的URL中,我包括Facebook ID人,这使我:

<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: 生成了具有ID的图像,但是当我在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. 我认为这是因为Facebook Object Debugger在抓取页面时未登录到您的应用程序,因此没有用户ID。

A solution would be to get the user ID from the URL. 一种解决方案是从URL获取用户ID。

To be more clear on @Yassine' answer, 为了更清楚@Yassine的答案,

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. 您正在为特定用户生成图像,这肯定是获取ID并将相应ID放入OG元标记的动态方式。

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. Facebook对象调试器无法从meta标记中识别ID,因为它没有登录到您的应用中,这意味着您的应用没有ID,因此在meta标记中未设置ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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