程序员人生 网站导航

【FacebookSDK学习笔记】Facebook消息分享

栏目:综合技术时间:2015-03-28 09:03:39

1.手机上要安装了Facebook Message才能使用这个功能

Google Play网址:https://play.google.com/store/apps/details?id=com.facebook.orca

 

2.直接添加1个button

 


3.添加监听事件便可

 

 

FacebookDialog.MessageDialogBuilder builder = new FacebookDialog.MessageDialogBuilder(getActivity()) .setLink("https://developers.facebook.com/docs/android/share/") .setName("Message Dialog Tutorial") .setCaption("Build great social apps that engage your friends.") .setPicture("http://i.imgur.com/g3Qc1HN.png") .setDescription("Allow your users to message links from your app using the Android SDK.") .setFragment(this); // If the Facebook app is installed and we can present the share dialog if (builder.canPresent()) { // Enable button or other UI to initiate launch of the Message Dialog FacebookDialog dialog = builder.build(); dialog.present(); } else { // Disable button or other UI for Message Dialog Log.e("===Error===","Error!No Message!");//出现此log说明未安装Messager }

以下图:


 

效果图::


本文来源CSDN博客http://blog.csdn.net/lovekam/article/details/44062839

 

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐