10
Chcę zaimplementować funkcję "Lubię to" i "Komentuj" w mojej aplikacji. Użyłem tego kodu:Jak zintegrować funkcję "Lubię to" i "Komentuj" przy użyciu pakietu Android Facebook SDK?
public static void like(String postID) {
String grapPath = String.format("%s/likes", postID);
Request request = new Request(Session.getActiveSession(), grapPath,
null, HttpMethod.POST, new Callback() {
@Override
public void onCompleted(Response response) {
Log.i(TAG, response.toString()+" Success!");
}
});
Request.executeBatchAsync(request);
}
public static void postComment(String comment, String postID) {
String grapPath = String.format("%s/comments", postID);
Bundle bundle = new Bundle();
bundle.putString("message", comment);
Request request = new Request(Session.getActiveSession(), grapPath,
bundle, HttpMethod.POST, new Callback() {
@Override
public void onCompleted(Response response) {
Log.i(TAG, "Success!");
}
});
Request.executeBatchAsync(request);
}
Hhow i gdzie mogę nazwać te metody, aby działały?
Dostałeś go do pracy? – Pradeep
dziękuję za twoją obecność, Pradeep! Zrobiłem to działało :) –
Czy to możliwe, aby udostępnić pewne zasoby, które ci pomogły? – Pradeep