FacebookDialog
A more recent version of this class is available. Check out the latest version.
Extends:Object
Package:widget
Class Methods
getNativeDialogDidComplete(Bundle)

Determines whether the native dialog completed normally (without error or exception).

public static boolean getNativeDialogDidComplete(Bundle result)
ParameterDescription
resultThe bundle passed back to onActivityResult
Returns
True if the native dialog completed normally
getNativeDialogCompletionGesture(Bundle)

Returns the gesture with which the user completed the native dialog. This is only returned if the user has previously authorized the calling app with basic permissions.

public static String getNativeDialogCompletionGesture(Bundle result)
ParameterDescription
resultThe bundle passed back to onActivityResult
Returns
"post" or "cancel" as the completion gesture
getNativeDialogPostId(Bundle)

Returns the id of the published post. This is only returned if the user has previously given the app publish permissions.

public static String getNativeDialogPostId(Bundle result)
ParameterDescription
resultThe bundle passed back to onActivityResult
Returns
The id of the published post
handleActivityResult(Context, PendingCall, int, Intent, Callback)

Parses the results of a dialog activity and calls the appropriate method on the provided Callback.

public static boolean handleActivityResult(Context context, PendingCall appCall, int requestCode, Intent data, Callback callback)
ParameterDescription
contextThe Context that is handling the activity result
appCallAn PendingCall containing the call ID and original Intent used to launch the dialog
requestCodeThe request code for the activity result
dataThe result Intent
callbackA callback to call after parsing the results
Returns
True if the activity result was handled, false if not
canPresentShareDialog(Context, ShareDialogFeature)

Determines whether the version of the Facebook application installed on the user's device is recent enough to support specific features of the native Share dialog, which in turn may be used to determine which UI, etc., to present to the user.

public static boolean canPresentShareDialog(Context context, ShareDialogFeature features)
ParameterDescription
contextThe calling Context
featuresZero or more features to check for; FacebookDialog.ShareDialogFeature.SHARE_DIALOG is implicitly checked if not explicitly specified
Returns
True if all of the specified features are supported by the currently installed version of the Facebook application; false if any of the features are not supported
canPresentMessageDialog(Context, MessageDialogFeature)

Determines whether the version of the Facebook application installed on the user's device is recent enough to support specific features of the native Message dialog, which in turn may be used to determine which UI, etc., to present to the user.

public static boolean canPresentMessageDialog(Context context, MessageDialogFeature features)
ParameterDescription
contextThe calling Context
featuresZero or more features to check for; FacebookDialog.MessageDialogFeature.MESSAGE_DIALOG is implicitly checked if not explicitly specified
Returns
True if all of the specified features are supported by the currently installed version of the Facebook application; false if any of the features are not supported
canPresentOpenGraphActionDialog(Context, OpenGraphActionDialogFeature)

Determines whether the version of the Facebook application installed on the user's device is recent enough to support specific features of the native Open Graph action dialog, which in turn may be used to determine which UI, etc., to present to the user.

public static boolean canPresentOpenGraphActionDialog(Context context, OpenGraphActionDialogFeature features)
ParameterDescription
contextThe calling Context
featuresZero or more features to check for; FacebookDialog.OpenGraphActionDialogFeature.OG_ACTION_DIALOG is implicitly checked if not explicitly specified
Returns
True if all of the specified features are supported by the currently installed version of the Facebook application; false if any of the features are not supported
canPresentOpenGraphMessageDialog(Context, OpenGraphMessageDialogFeature)

Determines whether the version of the Facebook application installed on the user's device is recent enough to support specific features of the native Open Graph Message dialog, which in turn may be used to determine which UI, etc., to present to the user.

public static boolean canPresentOpenGraphMessageDialog(Context context, OpenGraphMessageDialogFeature features)
ParameterDescription
contextThe calling Context
featuresZero or more features to check for; FacebookDialog.OpenGraphMessageDialogFeature.OG_MESSAGE_DIALOG is implicitly checked if not explicitly specified
Returns
True if all of the specified features are supported by the currently installed version of the Facebook application; false if any of the features are not supported
Instance Methods
present()

Launches an activity in the Facebook application to present the desired dialog. This method returns a PendingCall that contains a unique ID associated with this call to the Facebook application. In general, a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure proper processing of the results from this dialog.

public PendingCall present()
Returns
A PendingCall containing the unique call ID corresponding to this call to the Facebook application
Constants
COMPLETION_GESTURE_CANCEL
public static final String COMPLETION_GESTURE_CANCEL