Desidero implementare la funzione "Mi piace" e "Commento" nella mia app. Ho usato questo codice:Come integrare la funzionalità "Mi piace" e "Commento" utilizzando 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 e dove posso chiamare questi metodi per farli funzionare?
Hai avuto a farlo funzionare? – Pradeep
grazie per la vostra presenza, Pradeep! L'ho fatto funzionare :) –
Grande, sarebbe possibile condividere alcune risorse che ti hanno aiutato? – Pradeep