-
- 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 enum
ShareDialog.Mode
The mode for the share dialog.
public class
ShareDialog.Companion
-
Field Summary
Fields Modifier and Type Field Description private Integer
requestCode
-
Constructor Summary
Constructors Constructor Description ShareDialog(Activity activity)
Constructs a new ShareDialog. ShareDialog(Integer requestCode)
Constructs a new ShareDialog without any context. 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 Integer
getRequestCode()
final Unit
setRequestCode(Integer requestCode)
Set the request code for the startActivityForResult call. Boolean
getShouldFailOnDataError()
Specifies whether the sharer should fail if it finds an error with the share content. Unit
setShouldFailOnDataError(Boolean shouldFailOnDataError)
Specifies whether the sharer should fail if it finds an error with the share content. Boolean
canShow(ShareContent<?, ?> content, ShareDialog.Mode mode)
Call this to check if the Share Dialog can be shown in a specific mode. Unit
show(ShareContent<?, ?> content, ShareDialog.Mode mode)
Call this to show the Share Dialog in a specific mode -
Methods inherited from class com.facebook.share.widget.ShareDialog
canShow, createActivityResultContractForShowingDialog, registerCallback, registerCallback, setCallbackManager, show
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ShareDialog
ShareDialog(Activity activity)
Constructs a new ShareDialog.- Parameters:
activity
- Activity to use to share the provided content.
-
ShareDialog
ShareDialog(Integer requestCode)
Constructs a new ShareDialog without any context.
-
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
-
-
-
-