Search code examples
androidfacebookfacebook-graph-apifacebook-like

How to using Open Graph of Facebook SDK to like an Url in Android


I'm developing application in Android which can like a Url. Please provide me an example step by step to like a url using Open Graph of Facebook SDK.

Facebook provided the following source code, but I don't know how to use it correctly.

Bundle params = new Bundle();
params.putString("object", "http://samples.ogp.me/226075010839791");
/* make the API call */
new Request(
    session,
    "/me/og.likes",
    params,
    HttpMethod.POST,
    new Request.Callback() {
        public void onCompleted(Response response) {
            /* handle the result */
        }
    }
).executeAsync();

Solution

  • Using Open Graph to like as following link: https://developers.facebook.com/docs/opengraph/guides/og.likes