Facebook Restful PHP Client - 获取用户的事件 [英] Facebook Restful PHP Client - get Events of a User
问题描述
我正在使用 Facebook PHP 客户端库,并希望在不首先以用户身份登录的情况下获取用户的事件.
im using the Facebook PHP Client library and want to get the Events of a user without first logging in as a user.
这可能吗?
我得到了用户 ID,而 events.get 方法有一个参数 UID.
I got the User ID and the events.get method has a parameter UID.
<?php
// Configure
$apiKey = 'xxx';
$secretKey = 'xxx';
// Include Lib
require_once('facebook.php');
// init main object
$facebook = new Facebook($apiKey,$secretKey);
$events = $facebook->api_client->events_get(123456);
?>
所以这段代码不起作用.如果我首先需要某个用户的登录,我会得到我的结果.不登录就可以获取用户的事件吗?
so this piece of code does not work. if i first require a login of a certain user, i get my results. isnt it possible to get events of a user without logging in?
推荐答案
根据 Facebook API Docs for Events.get
According to the Facebook API Docs for Events.get
http://wiki.developers.facebook.com/index.php/Events.get
此方法不再需要会话密钥.但是,如果您在没有活动用户会话的情况下调用此方法,则只能获取您的应用程序为其创建者的事件;您只能看到那些授权您的应用程序的活动参加者.如果用户授予应用程序 create_event 扩展权限,应用程序可以为用户创建事件.
基本上,用户必须登录,否则您只能看到您的应用创建的事件.
Basically, the user has to be logged in otherwise you can only see events in which your app created.
这篇关于Facebook Restful PHP Client - 获取用户的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!