public final class ShareDialog extends FacebookDialogBase<ShareContent,Sharer.Result> implements Sharer
| Modifier and Type | Class and Description |
|---|---|
static class |
ShareDialog.Mode
The mode for the share dialog.
|
FacebookDialogBase.ModeHandlerSharer.Result| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
WEB_SHARE_DIALOG |
BASE_AUTOMATIC_MODE| Constructor and Description |
|---|
ShareDialog(android.app.Activity activity)
Constructs a new ShareDialog.
|
ShareDialog(androidx.fragment.app.Fragment fragment)
Constructs a new ShareDialog.
|
ShareDialog(android.app.Fragment fragment)
Constructs a new ShareDialog.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canShow(java.lang.Class<? extends ShareContent> contentType)
Indicates whether it is possible to show the dialog for
ShareContent of the specified type. |
boolean |
canShow(ShareContent content,
ShareDialog.Mode mode)
Call this to check if the Share Dialog can be shown in a specific mode.
|
protected AppCall |
createBaseAppCall() |
protected java.util.List<FacebookDialogBase.ModeHandler> |
getOrderedModeHandlers() |
boolean |
getShouldFailOnDataError()
Specifies whether the sharer should fail if it finds an error with the share content.
|
protected void |
registerCallbackImpl(com.facebook.internal.CallbackManagerImpl callbackManager,
FacebookCallback<Sharer.Result> callback) |
void |
setShouldFailOnDataError(boolean shouldFailOnDataError)
Specifies whether the sharer should fail if it finds an error with the share content.
|
static void |
show(android.app.Activity activity,
ShareContent shareContent)
Helper to show the provided
ShareContent using the provided
Activity. |
static void |
show(androidx.fragment.app.Fragment fragment,
ShareContent shareContent)
Helper to show the provided
ShareContent using the provided
Fragment. |
static void |
show(android.app.Fragment fragment,
ShareContent shareContent)
Helper to show the provided
ShareContent using the provided
Fragment. |
void |
show(ShareContent content,
ShareDialog.Mode mode)
Call this to show the Share Dialog in a specific mode
|
canShow, canShowImpl, getActivityContext, getRequestCode, registerCallback, registerCallback, setRequestCode, show, showImpl, startActivityForResultpublic static final java.lang.String WEB_SHARE_DIALOG
public ShareDialog(android.app.Activity activity)
activity - Activity to use to share the provided content.public ShareDialog(androidx.fragment.app.Fragment fragment)
fragment - androidx.fragment.app.Fragment to use to share the provided content.public ShareDialog(android.app.Fragment fragment)
fragment - android.app.Fragment to use to share the provided content.public static void show(android.app.Activity activity,
ShareContent shareContent)
ShareContent using the provided
Activity. No callback will be invoked.activity - Activity to use to share the provided contentshareContent - Content to sharepublic static void show(androidx.fragment.app.Fragment fragment,
ShareContent shareContent)
ShareContent using the provided
Fragment. No callback will be invoked.fragment - androidx.fragment.app.Fragment to use to share the provided contentshareContent - Content to sharepublic static void show(android.app.Fragment fragment,
ShareContent shareContent)
ShareContent using the provided
Fragment. No callback will be invoked.fragment - android.app.Fragment to use to share the provided contentshareContent - Content to sharepublic static boolean canShow(java.lang.Class<? extends ShareContent> contentType)
ShareContent of the specified type.contentType - Class of the intended ShareContent to
share.protected void registerCallbackImpl(com.facebook.internal.CallbackManagerImpl callbackManager,
FacebookCallback<Sharer.Result> callback)
registerCallbackImpl in class FacebookDialogBase<ShareContent,Sharer.Result>public boolean getShouldFailOnDataError()
SharergetShouldFailOnDataError in interface Sharerpublic void setShouldFailOnDataError(boolean shouldFailOnDataError)
SharersetShouldFailOnDataError in interface SharershouldFailOnDataError - whether the dialog should fail if it finds an error.public boolean canShow(ShareContent content, ShareDialog.Mode mode)
mode - Mode of the Share Dialogpublic void show(ShareContent content, ShareDialog.Mode mode)
mode - Mode of the Share Dialogprotected AppCall createBaseAppCall()
createBaseAppCall in class FacebookDialogBase<ShareContent,Sharer.Result>protected java.util.List<FacebookDialogBase.ModeHandler> getOrderedModeHandlers()
getOrderedModeHandlers in class FacebookDialogBase<ShareContent,Sharer.Result>