即时通讯使用Facebook PHP客户端库,想要在不先以用户身份登录的情况下获取用户的事件。
这可能吗?
我获得了用户ID,events.get方法有一个参数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);
?>
所以这段代码不起作用。 如果我首先要求某个用户登录,我会得到我的结果。 是不是可以在没有登录的情况下获取用户的事件?
答案 0 :(得分:1)
根据Facebook API Docs for Events.get
http://wiki.developers.facebook.com/index.php/Events.get
This method no longer requires a session key. However if you call this method without an active user session, you can only get the events for which your application was the creator; you can see only those event attendees who authorized your application. Applications can create events for users if the users grant the application the create_event extended permission.
基本上,用户必须登录,否则您只能看到应用程序创建的事件。