使用某些 facebook 页面 id/用户名访问图形 api 时出现问题
我已经成功制作了一个 facebook 应用程序,它显示来自 facebook graph api 的实时数据,无需身份验证。我使用的方法是与图形 API 的简单连接,因为我只需要它的基本信息。
$url = 'http://graph.facebook.com/'.$pagename;
// for id
$url = 'http://graph.facebook.com/'.$page_id;
$pageinfo = json_decode(file_get_contents($url));
这种方法效果很好,但不适用于 facebook 中的某些页面。我的客户已将这些页面网址发送给我。从我的电脑但无法访问这些页面(Facebook 将我重定向到主页)。我还尝试通过这些页面用户名和 ID 访问图表。它只是返回false
。
这是这些页面。 请注意,并非所有页面,只有少数页面存在此问题:
https://www.facebook。 com/MontanaDaleCarnegie
https://www.facebook.com/pages/The-Painted-Swan-Online-Marketing/223492000998546
我找不到这些页面无法访问的问题。页面设置页面中是否有任何设置使页面不公开或无法通过图形 API 访问?客户说他可以访问这些页面。
我需要你的经验来克服这种情况。谢谢!
I have successfully made an facebook application which shows real time data from facebook graph api with no authentication. The method i have used is something the simple connection to the graph api because i only need the basic info for it.
$url = 'http://graph.facebook.com/'.$pagename;
// for id
$url = 'http://graph.facebook.com/'.$page_id;
$pageinfo = json_decode(file_get_contents($url));
This methord works fine but not for some pages in facebook. My client has send those pages url to me. From my pc but can't access those page (facebook redirects me to the homepage). Also i have tried to access the graph via those page username and id. Its just returning false
.
Here are those pages. Note that not all pages but a few has this problem:
https://www.facebook.com/MontanaDaleCarnegie
https://www.facebook.com/pages/The-Painted-Swan-Online-Marketing/223492000998546
I can't find the issue why these pages aren't accessible. Is there any settings in the page settings page that make the page nonpublic or inaccessible via graph api? The client saying that he can access these pages.
I need your experience an input to overcome this situation. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然,如果任何页面的隐私设置受到限制,则该页面信息无法公开访问。
有几种情况:
您可能会发现它很有帮助 http://bugs.developers.facebook.net/show_bug.cgi?id=18162 检查评论 #3。
Apparently if any page has privacy setting restricted the page info can't be access in public.
There is couple of cases:
You might find it helpfull http://bugs.developers.facebook.net/show_bug.cgi?id=18162 Check comment #3.
我尝试查看您的两个示例,它们都将我带回到主屏幕。这当然意味着这些页面不公开。
是:在“管理权限”下的页面设置中,有一个“页面可见性”复选框:
如果选中此复选框,则 facebook 上的用户和图形 api 都无法访问它。唯一的可能性是(但我不确定)使用 来自其中一位管理员的离线访问令牌。
I tried to take a look at your two examples and both take me back to the home screen. This certainly means that those pages are not publicly available.
Yes: In the page settings under "manage permissions" there is a checkbox for "page visibility":
If this is checkbox is selected, neither a user on facebook nor the graph api have access to it. The only possibility would be (but I'm not sure) to use an offline access token from one of the admins.