简体   繁体   中英

android facebook sdk 3.0 custom like button

I'm using Facebook SDK 3.0 for Android.

how make a custom likes button

Request request = new Request(session, page_id + "/likes", null, HttpMethod.POST,  new Callback()
{
    @Override
    public void onCompleted(Response response)
    {
        Log.i(DEBUG_TAG, response.toString());
        // TODO Auto-generated method stub
        if (response.getGraphObject() != null)
        {
            //Log.i(DEBUG_TAG, response.toString());
        }
    }
});
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();

page_id = 417732304946490

has OAuthException (#3) Application does not have the capability to make this API call.

no way use in app like ?

The Facebook graph API does not provide the feature to Like the facebook page. Instead you can open a webview with your page URL, so that your can Log in and Like your page.

 // To open webview
 String url = "your page URL";
 Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
 startActivity(i);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM