我必须获取在Android中登录我的应用程序的当前用户的事件列表,并且我正在使用以下代码来提取列表:
String fqlQuery = "SELECT eid, name, pic, creator, start_time FROM event WHERE eid IN " + " (SELECT eid FROM event_member WHERE uid = me() LIMIT 25)";
Bundle params = new Bundle();
params.putString("q", fqlQuery);
Session session = Session.getActiveSession();
Request request = new Request(session,
"/fql",
params,
HttpMethod.GET,
new Request.Callback(){
public void onCompleted(Response response) {
Log.i(TAG, "Result: " + response.toString());
}
});
Request.executeBatchAsync(request);
}
但是我总是得到空白的结果集。请让我知道我在这里想念什么。我对此并不陌生,并尝试向Facebook开发人员指南学习。
我正在为我的应用程序使用的权限:
这不是您设置权限的地方,这是针对App Center的。该页面顶部有一个注释。
使用这些设置输入在App Center中显示时您的应用所需的一组权限
您需要在Android代码中添加权限范围
Android登录使用LoginButton类上的setReadPermissions和setPublishPermissions。
https://developers.facebook.com/docs/facebook-login/permissions/#adding
例如在Android登录教程中
LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setFragment(this);
authButton.setReadPermissions(Arrays.asList("user_events", "friends_events"));
https://developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/#step3
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句