允许 1 个 Facebook 应用的多个域(如 Tumblr) [英] Allowing multiple domains for 1 Facebook App (like Tumblr)

查看:19
本文介绍了允许 1 个 Facebook 应用的多个域(如 Tumblr)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Facebook 对象调试器验证我的网站,但遇到以下错误:

I am trying to get my website validated with the Facebook object debugger and I'm running into the following error:

位于 URL 'http://www.example.com/latest' 类型的对象'smallteaser:teaser' 无效,因为域指定的应用程序 ID 不允许使用www.example.com"'597566643589666'.

Object at URL 'http://www.example.com/latest' of type 'smallteaser:teaser' is invalid because the domain 'www.example.com' is not allowed for the specified application id '597566643589666'.

这个错误是完全合理的,因为我没有允许 example.com 域特定访问 Facebook 应用程序.但我真的必须这样做吗?

This error makes perfect sense since I haven't allowed the example.com domain specific access to the Facebook app. But do I really have to?

我想要实现的类似于使用自定义域时 Tumblr 的工作方式.例如,网站 www.davidslog.com:它具有以下元标记:

What I would like to achieve is similar to how Tumblr works when a custom domain is used. Say, for example, the website www.davidslog.com: it has the following meta tags:

<meta property="fb:app_id" content="48119224995" />

   --> This is the Tumblr app ID


<meta property="og:url" content="http://www.davidslog.com/?og=1" />

   --> This is a custom domain which points to a Tumblr blog


<meta property="og:type" content="tumblr-feed:tumblelog" />

   --> This is a custom Tumblr object type (in namespace tumblr-feed)

然后,如果您将其与域 theartofnotwriting.tumblr.com 进行比较,该域具有以下元数据:

And if you then compare this with, for instance, the domain theartofnotwriting.tumblr.com, which has the following metadata:

<meta property="fb:app_id" content="48119224995">

   --> This is the same Tumblr app ID

<meta property="og:url" content="http://theartofnotwriting.tumblr.com/?og=1">

   --> This is a different domain

<meta property="og:type" content="tumblr-feed:tumblelog">

您可以清楚地看到同一个 Tumblr 应用有多个 URL,并且所有内容都经过正确验证.

You can clearly see that the same Tumblr app has multiple URLs and everything validates correctly.

那么为什么这个 Tumblr 页面可以正确验证而我的却不能?如何配置 Facebook 应用以允许在多个域上使用?

So why is it that this Tumblr page validates correctly and mine doesn't? How can a Facebook app be configured to allow being used on multiple domains?

推荐答案

我遇到了同样的问题.我认为 Tumblr 必须与 Facebook 建立某种合作关系才能获得这种特殊待遇(ip 白名单?特殊 api?)——所以我联系了我在 Facebook 的前合作伙伴代表进行询问.

I ran into this same issue. I figured that Tumblr must have some sort of partnership in place with Facebook to get this special treatment ( ip whitelist? special api? ) -- so I contacted my former Partnerships Rep at Facebook to enquire.

我不得不与 Facebook 的一位平台工程师讨论此事,但我完全错了.没什么特别的.

I got to speak with a platform engineer at Facebook about this, and I was totally wrong. There is nothing special going on.

在 Tumblr 上运行的所有域都可以通过单个 app_id 进行验证的原因是,facebook 调试工具仅检查 og_tag 结构的有效性(至少在涉及 app_id 时).它不会验证 app_id 是否与给定域正确关联.

The reason why all the domains running on Tumblr are validating fine with a single app_id, is that the facebook debug tool only checks the validity of the og_tag's structure (at least when it comes to the app_id). It does not validate if the app_id is properly associated with the given domain.

您可以通过在两个不同的域上放置带有您的 app_id 的测试页面来测试这一点——它们都将在调试工具中进行验证.

You can test this by putting up a test page with the your app_id on two different domains -- they'll both validate as fine in the debug tool.

当涉及到实际的 Facebook API 访问时,Tumblr 在他们的域中做所有事情.当人们在 Tumblr 上使用 Facebook 按钮/等时,通常是通过第三方代理工具(如 ShareThis)或嵌入非 api 按钮.我找不到在 Tumblr 上运行的使用 Facebook API 或 app_id 相关按钮的单个自定义域.如果可以,我很想看看.

When it comes to actual Facebook API access, Tumblr does everything on their domain. When people do use Facebook buttons/etc on Tumblr, it is often through a third party proxy tool (like ShareThis) or with a non-api button embed. I couldn't find a single custom-domain running on Tumblr that used the Facebook API or app_id related buttons. If you can, I'd love to see it.

这不是您想要(或我想要)的答案——但这就是正在发生的事情.Tumblr 的 app_id 出现在所有域中,但实际上只适用于.tumblr.com";Facebook 调试工具实际上并未验证 app_id.

It's the not answer you want (or I want) -- but that is what is happening. Tumblr's app_id appears on all the domains, but only actually works on ".tumblr.com"; The Facebook debug tool doesn't actually validate the app_id.

这篇关于允许 1 个 Facebook 应用的多个域(如 Tumblr)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆