简体   繁体   English

iframe应用上的Facebook社交功能

[英]Facebook social features on iframe app

We are developing a facebook iframe application that pulls some images (via an API) to the current user album (creates a new one). 我们正在开发一个Facebook iframe应用程序,该应用程序将一些图像(通过API)提取到当前用户相册(创建新相册)。

The user views his newly uploaded album photos using a facebook lightbox clone. 用户使用Facebook灯箱克隆查看他新上传的相册照片。 In this clone he must be able to comment and like the current viewed photo. 在这个副本中,他必须能够评论并喜欢当前查看的照片。

Is there a way to provide facebook comments & like to these pictures without the use of the Graph API (which would require us to replicate a lot of visuals). 有没有一种方法可以在不使用Graph API的情况下为这些图片提供Facebook评论和喜欢的图片(这将需要我们复制大量的视觉效果)。

Another try was the social plug-ins with the facebook photo url given but no success. 另一个尝试是提供了Facebook照片网址的社交插件,但没有成功。

Any ideas? 有任何想法吗?

I would recommend using the social plugins that facebook provide. 我建议使用Facebook提供的社交插件。

For the likes and comments you can specify a URL in the plugin code, that URL should be the URL of the photo relative to your app eg http://myapp.com/photo/123 and not the http://app.facebook.com address. 对于喜欢和评论,您可以在插件代码中指定一个URL,该URL应该是相对于您的应用的照片的URL,例如http://myapp.com/photo/123而不是http://app.facebook .com地址。

Facebook will need to be able to crawl that URL so if you are checking if the user is logged in via PHP then you should either disable this if the user agent contains facebookexternalhit or show a different page for that user agent. Facebook将需要能够爬网该URL,因此,如果您要检查用户是否通过PHP登录,则如果用户代理包含facebookexternalhit则应该禁用此URL,或者显示该用户代理的其他页面。 It doesn't matter about the content, just set a couple of og: meta tags and that should be fine. 内容无关紧要,只需设置几个og: meta标签 ,就可以了。

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

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