在Android和iPhone整合Facebook与像按钮按钮、Android、iPhone、Facebook

2023-09-12 02:09:09 作者:太阳还暖i

我想在Android和iPhone整合Facebook与像按钮。我在Android和iPhone整合Facebook的也是,但我并没有像集成按钮。所以,请告诉我如何Facebook的整合像Android的按钮,以及在iPhone上。

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 how to integrate the facebook like button in android and also in iphone.

有关整合,我用下面的链接比如在Android的Facebook的

For integrate the facebook i used below link example in android

https://github.com/facebook/facebook-android-sdk

现在我有整合像按钮Facebook的。

Now i have to integrate the facebook like button.

最好的问候。

在此先感谢。

推荐答案

有一个在Facebook的图形API没有像按钮。有一些替代品可以选择。首先,你可以使用web视图,并显示在一个web视图等按钮。

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 /

另一种方法是使用Facebook的Andr​​oid的SDK Facebook分享功能。

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

最后,更全面的方法是使用一个意图,并让用户选择如何分享它。 (它可以是任何应用程序,包括Facebook)

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"));