[英]How to get user likes from Facebook with Android sdk 3.0
I would get user likes from facebook using Android sdk 3.0 beta. 我会使用Android SDK 3.0 Beta从Facebook获得用户喜欢。
How do I do this? 我该怎么做呢?
Provided that you have a valid session, this is the code to get the user likes 只要您有一个有效的会话,这就是获得用户喜欢的代码
Session session = Session.getActiveSession();
Request.Callback callback = new Request.Callback() {
@Override
public void onCompleted(Response response) {
// response should have the likes
Toast.makeText(getApplicationContext(), response.toString(), Toast.LENGTH_LONG).show();
}
};
Request request = new Request(session, "me/likes", null, HttpMethod.GET, callback);
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.