Android SDK Version
All Implemented Interfaces:

public final class MessageDialog
extends com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>
implements Sharer
Provides functionality to send content via the Facebook Message Dialog SUPPORTED SHARE TYPES - ShareLinkContent - ShareCameraEffectContent - ShareMessengerOpenGraphMusicTemplateContent - ShareMessengerMediaTemplateContent - ShareMessengerGenericTemplateContent UNSUPPORTED SHARE TYPES (DEPRECATED AUGUST 2018) - ShareOpenGraphContent - SharePhotoContent - ShareVideoContent - Any other types that are not one of the four supported types listed above
Nested Class Summary
Nested classes/interfaces inherited from class com.facebook.internal.FacebookDialogBase
com.facebook.internal.FacebookDialogBase.ModeHandler
Nested classes/interfaces inherited from interface com.facebook.share.
Sharer.Result
Field Summary
Fields inherited from class com.facebook.internal.FacebookDialogBase
BASE_AUTOMATIC_MODE
Constructor Summary
Constructor and Description
MessageDialog(Activity activity)
Constructs a MessageDialog.
MessageDialog(android.app.Fragment fragment)
Constructs a MessageDialog.
MessageDialog(Fragment fragment)
Constructs a MessageDialog.
Method Summary
Modifier and TypeMethod and Description
static booleancanShow(java.lang.Class<? extends ShareContent> contentType)
Indicates whether it is possible to show the dialog for ShareContent of the specified type.
protected com.facebook.internal.AppCallcreateBaseAppCall() 
protected java.util.List<com.facebook.internal.FacebookDialogBase.ModeHandler>getOrderedModeHandlers() 
booleangetShouldFailOnDataError()
Specifies whether the sharer should fail if it finds an error with the share content.
protected voidregisterCallbackImpl(com.facebook.internal.CallbackManagerImpl callbackManager, FacebookCallback<Sharer.Result> callback) 
voidsetShouldFailOnDataError(boolean shouldFailOnDataError)
Specifies whether the sharer should fail if it finds an error with the share content.
static voidshow(Activity activity, ShareContent shareContent)
Helper to show the provided ShareContent using the provided Activity.
static voidshow(android.app.Fragment fragment, ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment.
static voidshow(Fragment fragment, ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment.
Methods inherited from class com.facebook.internal.FacebookDialogBase
canShow, canShowImpl, getActivityContext, getRequestCode, registerCallback, registerCallback, setRequestCode, show, showImpl, startActivityForResult
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

MessageDialog

public MessageDialog(Activity activity)
Constructs a MessageDialog.
Parameters:
activity - Activity to use to send the provided content.

MessageDialog

public MessageDialog(Fragment fragment)
Constructs a MessageDialog.
Parameters:
fragment - android.support.v4.app.Fragment to use to send the provided content.

MessageDialog

public MessageDialog(android.app.Fragment fragment)
Constructs a MessageDialog.
Parameters:
fragment - android.app.Fragment to use to send the provided content.
Method Detail

show

public static void show(Activity activity,
                        ShareContent shareContent)
Helper to show the provided ShareContent using the provided Activity. No callback will be invoked.
Parameters:
activity - Activity to use to send the provided content
shareContent - Content to send

show

public static void show(Fragment fragment,
                        ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment. No callback will be invoked.
Parameters:
fragment - android.support.v4.app.Fragment to use to send the provided content
shareContent - Content to send

show

public static void show(android.app.Fragment fragment,
                        ShareContent shareContent)
Helper to show the provided ShareContent using the provided Fragment. No callback will be invoked.
Parameters:
fragment - android.app.Fragment to use to send the provided content
shareContent - Content to send

canShow

public static boolean canShow(java.lang.Class<? extends ShareContent> contentType)
Indicates whether it is possible to show the dialog for ShareContent of the specified type.
Parameters:
contentType - Class of the intended ShareContent to send.
Returns:
True if the specified content type can be shown via the dialog

registerCallbackImpl

protected void registerCallbackImpl(com.facebook.internal.CallbackManagerImpl callbackManager,
                                    FacebookCallback<Sharer.Result> callback)
Specified by:
registerCallbackImpl in class com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>

getShouldFailOnDataError

public boolean getShouldFailOnDataError()
Description copied from interface: Sharer
Specifies whether the sharer should fail if it finds an error with the share content. If false, the share dialog will still be displayed without the data that was mis-configured. For example, an invalid placeID specified on the shareContent would produce a data error.
Specified by:
Returns:
A Boolean value.

setShouldFailOnDataError

public void setShouldFailOnDataError(boolean shouldFailOnDataError)
Description copied from interface: Sharer
Specifies whether the sharer should fail if it finds an error with the share content. If false, the share dialog will still be displayed without the data that was mis-configured. For example, an invalid placeID specified on the shareContent would produce a data error.
Specified by:
Parameters:
shouldFailOnDataError - whether the dialog should fail if it finds an error.

createBaseAppCall

protected com.facebook.internal.AppCall createBaseAppCall()
Specified by:
createBaseAppCall in class com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>

getOrderedModeHandlers

protected java.util.List<com.facebook.internal.FacebookDialogBase.ModeHandler> getOrderedModeHandlers()
Specified by:
getOrderedModeHandlers in class com.facebook.internal.FacebookDialogBase<ShareContent,Sharer.Result>