我有一个包含酒精内容的网站,我已将其注册为 Facebook 应用程序。当我使用图形 API (https://graph.facebook.com/APP_ID?restrictions={"age_distribution":"21+"} or {"type":"alcohol"}) 设置应用程序限制时,应用程序链接在Facebook 对未成年人帐户是隐藏的,这很棒。
问题是,当一个以上年龄的人在网站上点赞或分享一个页面时,他们的未成年 friend 可以在以上年龄的人的个人资料墙上看到喜欢的内容。有没有办法从未成年帐户的 Angular 隐藏用户墙上的“喜欢”和“分享”帖子?我在其他网站上看到过这样做,但我自己无法复制。
以下是我在网站上使用的元标记和 javascript 调用:
<meta property="og:title" content="FB Restrictions"/>
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="FB Restrictions Site"/>
<meta property="og:description" content="Testing Facebook Age Restrictions"/>
<meta property="fb:app_id" content="MyAppID"/>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'MyAppID', status: true, cookie: true,xfbml: true});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
预先感谢您的帮助!
最佳答案
根据 Facebook's User Restrictions Documentation ,您可以通过在您试图限制的页面上使用以下 Open Graph 元标记来实现:
年龄限制
<meta property="og:restrictions:age" content="21+"/>
您还可以设置基于内容的酒精限制,方法是:
<meta property="og:restrictions:content" content="alcohol"/>
此外,您还可以设置国家限制:
<meta property="og:restrictions:country:allowed" content="US" />
<meta property="og:restrictions:country:disallowed" content="CN" />
*请注意,标记中只能有一个 :allowed
或一个 :disallowed
实例。
关于javascript - 网站应用程序年龄限制喜欢和分享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8218466/