将facebook与android和iphone中的like按钮集成 [英] integrate facebook with like button in android and iphone

查看:30
本文介绍了将facebook与android和iphone中的like按钮集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 facebook 与 android 和 iphone 中的按钮集成.我也在 android 和 iphone 中集成了 facebook,但我没有像 button 那样集成.所以请告诉我如何在android和iphone中集成facebook like按钮.

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 graph api 中没有点赞按钮.您可以选择一些替代方案.首先,您可以使用 webview 并在 webview 中显示喜欢按钮.

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

这篇关于将facebook与android和iphone中的like按钮集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆