integrate facebook with like button in android and iphone

后端 未结 3 557
南旧
南旧 2020-12-05 16:27

I want to integrate facebook with like button in android and iphone. I integrated facebook in android and iphone also but i didn\'t integrate like button . So please tell me

3条回答
  •  心在旅途
    2020-12-05 16:54

    There is no like button in facebook graph api. There are some alternatives that you can select. First you can use a webview and show the like button in a webview.

    https://developers.facebook.com/docs/reference/plugins/like/

    Another alternative is using facebook share functionality in facebook-android-sdk.

    Last and more general alternative is using an intent and let the user select how to share it. (it can be any app including facebook)

    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
    shareIntent.setType("text/plain");
    shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "YOUR SUBJECT HERE!");
    shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "YOUR TEXT HERE");
    startActivity(Intent.createChooser(shareIntent, "YOUR TITLE HERE"));
    

提交回复
热议问题