- Declare these variables
private static final List<String> PERMISSIONS = Arrays.asList("publish_actions");private CallbackManager callbackManager;
private ShareDialog shareDialog;
- initialize callbackmanager
callbackManager = CallbackManager.Factory.create();
- Now Call this method to share content on facebook (including text,url etc)
private void postStatusUpdate() {
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle("Hello Facebook")
.setContentDescription(
"The 'Hello Facebook' sample showcases simple Facebook integration")
.setContentUrl(Uri.parse("http://developers.facebook.com/docs/android"))
.build();
ShareApi.share(linkContent, shareCallback);
}
No comments:
Post a Comment