In order to better support sharing on TVs, the Facebook SDK for Android has built-in support for Facebook Sharing for Devices. This sharing does not require Facebook Login and is ideal for TV environments because it doesn't require using the remote.
You can share links via
ShareLinkContent or open graph stories via
Use the Device Share Button to provide a share button that triggers the Sharing for Devices flow.
ShareLinkContent content = new ShareLinkContent.Builder() .setContentUrl( Uri.parse("https://developers.facebook.com/docs/android/devices")) .build(); DeviceShareButton button = (DeviceShareButton)view.findViewById(R.id.share_button); //button.setFragment(this); //optional setter if the instance is in a fragment and you want to register a callback. button.setShareContent(content);
Or programmatically present the Sharing for Devices dialog using a Device Share Dialog.
DeviceShareDialog dialog = new DeviceShareDialog(this); dialog.show(content);
However, device sharing never returns information about whether the person actually completed the share. Therefore, the callback will always receive an
onSuccess, indicating only that the person closed the share dialog, or
onError, indicating that the sharing flow was interrupted.