Postingan lainnya
Facebook Dev Delete Comment
Permisi juragan2, mau nanya nih, gimana ya caranya biar bisa hapus comment yg muncul di halaman kita, sedangkan fitur comment itu kita pake plugin facebook.
4 Jawaban:
bisa dicek di graph API facebook langsung https://developers.facebook.com/docs/graph-api/reference/v2.8/comment di bagian delete ada
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
$session,
'DELETE',
'/{comment-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
nah itu yg masih ane bingungin bang @hilmanrdn, di bagian {comment-id} itu get nya darimana ya? terus manggil php nya itu waktu user klik tombol gitu kan ya?
bisa dicek di graph API facebook langsung https://developers.facebook.com/docs/graph-api/reference/v2.8/comment fnf di bagian delete ada
// Set the access token and comment ID $accessToken = 'YOUR_ACCESS_TOKEN'; $commentId = 'COMMENT_ID';// Make a DELETE request to the comment endpoint $response = file_get_contents("https://graph.facebook.com/v12.0/{$commentId}?access_token={$accessToken}", false, stream_context_create([ 'http' => [ 'method' => 'DELETE io games' ] ]));
// Check the response status if ($response === false) { echo 'Error deleting comment'; } else {