Facebook Restful PHP客户端 - 获取用户的事件 [英] Facebook Restful PHP Client - get Events of a User

查看:133
本文介绍了Facebook Restful PHP客户端 - 获取用户的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



可以这样做吗?



我得到了用户ID,而event.get方法有一个参数UID。

 <?php 
//配置
$ apiKey ='xxx';
$ secretKey ='xxx';

//包含Lib
require_once('facebook.php');

// init主对象
$ facebook = new Facebook($ apiKey,$ secretKey);
$ events = $ facebook-> api_client-> events_get(123456);
?>

所以这段代码不起作用。
如果我首先需要某个用户的登录,我得到我的结果。
是否可以获取用户的事件而不登录?

解决方案

根据Facebook API文档.get



http ://wiki.developers.facebook.com/index.php/Events.get



此方法不再需要会话键。但是,如果您在没有活动用户会话的情况下调用此方法,则只能获取应用程序作为创建者的事件;您只能看到那些授权您的应用程序的活动参与者。如果用户向应用程序授予create_event扩展权限,应用程序可以为用户创建事件。



基本上,用户必须先登录,否则你只能看到您的应用创建的事件。


im using the Facebook PHP Client library and want to get the Events of a user without first logging in as a user.

Is that possible?

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?

解决方案

According to the 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.

Basically, the user has to be logged in otherwise you can only see events in which your app created.

这篇关于Facebook Restful PHP客户端 - 获取用户的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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