Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用graph Api获取Facebook页面事件_Android_Facebook_Events_Facebook Graph Api_Facebook Android Sdk - Fatal编程技术网

Android 使用graph Api获取Facebook页面事件

Android 使用graph Api获取Facebook页面事件,android,facebook,events,facebook-graph-api,facebook-android-sdk,Android,Facebook,Events,Facebook Graph Api,Facebook Android Sdk,我正在尝试使用facebook图形api从页面配置文件中获取facebook事件。 我使用的方法如下所示 HttpClient client = new DefaultHttpClient(); HttpGet get = new HttpGet("https://graph.facebook.com/oauth/access_token?client_id="+APP_ID+"&client_secret="+APP_SECRET+"&grant_type=client_cre

我正在尝试使用facebook图形api从页面配置文件中获取facebook事件。 我使用的方法如下所示

HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet("https://graph.facebook.com/oauth/access_token?client_id="+APP_ID+"&client_secret="+APP_SECRET+"&grant_type=client_credentials");
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String access_token = client.execute(get, responseHandler);
String uri = "https://graph.facebook.com/PageName/events?"+access_token.replace("|","%7C");
get = new HttpGet(uri);
String responseBody = client.execute(get, responseHandler);
HttpClient=newdefaulthttpclient();
HttpGet=新的HttpGet(“https://graph.facebook.com/oauth/access_token?client_id=“+APP_ID+”&client_secret=“+APP_secret+”&grant_type=client_凭证”);
ResponseHandler ResponseHandler=新BasicResponseHandler();
String access_token=client.execute(get,responseHandler);
字符串uri=”https://graph.facebook.com/PageName/events?+访问令牌。替换(“|”),“%7C”);
get=新的HttpGet(uri);
String responseBody=client.execute(get,responseHandler);
在其中,我将用我的详细信息替换APP_ID、APP_SECRET和PageName。 它的工作没有问题,我也从Facebook得到了json数组的响应,其中包括事件的名称、开始时间、结束时间、时区、位置、id,但没有事件描述


如何解决此问题?

使用您在响应中获得的
事件ID
,并使用它从以下位置获取该事件的每个细节:

"https://graph.facebook.com/EVENT_ID"

默认情况下,您不会获得事件描述,但您可以使用
字段
以及所需的其他信息在中添加事件描述,并检索更详细的列表。因此,您需要将uri更改为

String uri = "https://graph.facebook.com/PageName/events?fields=name,start_time,timezone,location,description"+access_token.replace("|","%7C");

检索所需信息。

有人知道为什么它在本页上不起作用吗?要使用webbrowser输入,请使用