-
- All Implemented Interfaces:
-
com.facebook.FacebookDialog,com.facebook.share.Sharer
public class ShareDialog extends FacebookDialogBase<ShareContent<?, ?>, Sharer.Result> implements Sharer
Provides functionality to share content via the Facebook Share Dialog
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumShareDialog.ModeThe mode for the share dialog.
public classShareDialog.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntegerrequestCode
-
Constructor Summary
Constructors Constructor Description ShareDialog(Activity activity)Constructs a new ShareDialog. ShareDialog(Fragment fragment)Constructs a new ShareDialog. ShareDialog(Fragment fragment)Constructs a new ShareDialog. ShareDialog(Activity activity, Integer requestCode)for internal use only ShareDialog(Fragment fragment, Integer requestCode)for internal use only ShareDialog(Fragment fragment, Integer requestCode)for internal use only ShareDialog(FragmentWrapper fragmentWrapper, Integer requestCode)for internal use only
-
Method Summary
Modifier and Type Method Description final IntegergetRequestCode()final UnitsetRequestCode(Integer requestCode)Set the request code for the startActivityForResult call. BooleangetShouldFailOnDataError()Specifies whether the sharer should fail if it finds an error with the share content. UnitsetShouldFailOnDataError(Boolean shouldFailOnDataError)Specifies whether the sharer should fail if it finds an error with the share content. BooleancanShow(ShareContent<?, ?> content, ShareDialog.Mode mode)Call this to check if the Share Dialog can be shown in a specific mode. Unitshow(ShareContent<?, ?> content, ShareDialog.Mode mode)Call this to show the Share Dialog in a specific mode -
-
Constructor Detail
-
ShareDialog
ShareDialog(Activity activity)
Constructs a new ShareDialog.- Parameters:
activity- Activity to use to share the provided content.
-
ShareDialog
ShareDialog(Fragment fragment)
Constructs a new ShareDialog.- Parameters:
fragment- androidx.fragment.app.Fragment to use to share the provided content.
-
ShareDialog
ShareDialog(Fragment fragment)
Constructs a new ShareDialog.- Parameters:
fragment- android.app.Fragment to use to share the provided content.
-
ShareDialog
ShareDialog(FragmentWrapper fragmentWrapper, Integer requestCode)
for internal use only
-
-
Method Detail
-
getRequestCode
final Integer getRequestCode()
-
setRequestCode
final Unit setRequestCode(Integer requestCode)
Set the request code for the startActivityForResult call. The requestCode should be outside of the range of those reserved for the Facebook SDK .
- Parameters:
requestCode- the request code to use.
-
getShouldFailOnDataError
Boolean getShouldFailOnDataError()
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.
-
setShouldFailOnDataError
Unit setShouldFailOnDataError(Boolean shouldFailOnDataError)
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.
- Parameters:
shouldFailOnDataError- whether the dialog should fail if it finds an error.
-
canShow
Boolean canShow(ShareContent<?, ?> content, ShareDialog.Mode mode)
Call this to check if the Share Dialog can be shown in a specific mode.
- Parameters:
mode- Mode of the Share Dialog
-
show
Unit show(ShareContent<?, ?> content, ShareDialog.Mode mode)
Call this to show the Share Dialog in a specific mode
- Parameters:
mode- Mode of the Share Dialog
-
-
-
-