-
public class BranchShareSheetBuilderClass for building a share link dialog.This creates a chooser for selecting application for sharing a link created with given parameters.
-
-
Constructor Summary
Constructors Constructor Description BranchShareSheetBuilder(Activity activity, JSONObject parameters)Creates options for sharing a link with other Applications. BranchShareSheetBuilder(Activity activity, BranchShortLinkBuilder shortLinkBuilder)*Creates options for sharing a link with other Applications.
-
Method Summary
Modifier and Type Method Description BranchShareSheetBuildersetMessage(String message)Sets the message to be shared with the link. BranchShareSheetBuildersetSubject(String subject)Sets the subject of this message. BranchShareSheetBuilderaddTag(String tag)Adds the given tag an iterable Collection of String tags associated with a deeplink. BranchShareSheetBuilderaddTags(ArrayList<String> tags)Adds the given tag an iterable Collection of String tags associated with a deeplink. BranchShareSheetBuildersetFeature(String feature)Adds a feature that make use of the link. BranchShareSheetBuildersetStage(String stage)Adds a stage application or user flow associated with this link. BranchShareSheetBuildersetCallback(Branch.BranchLinkShareListener callback)Adds a callback to get the sharing status. BranchShareSheetBuildersetChannelProperties(Branch.IChannelProperties channelPropertiesCallback)BranchShareSheetBuilderaddPreferredSharingOption(SharingHelper.SHARE_WITH preferredOption)Adds application to the preferred list of applications which are shown on share dialog.Only these options will be visible when the application selector dialog launches. BranchShareSheetBuilderaddPreferredSharingOptions(ArrayList<SharingHelper.SHARE_WITH> preferredOptions)Adds application to the preferred list of applications which are shown on share dialog.Only these options will be visible when the application selector dialog launches. BranchShareSheetBuilderaddParam(String key, String value)Add the given key value to the deep link parameters BranchShareSheetBuildersetDefaultURL(String url)Set a default url to share in case there is any error creating the deep link BranchShareSheetBuildersetMoreOptionStyle(Drawable icon, String label)Set the icon and label for the option to expand the application list to see more options. BranchShareSheetBuildersetMoreOptionStyle(int drawableIconID, int stringLabelID)Set the icon and label for the option to expand the application list to see more options. BranchShareSheetBuildersetCopyUrlStyle(Drawable icon, String label, String message)Set the icon, label and success message for copy url option. BranchShareSheetBuildersetCopyUrlStyle(int drawableIconID, int stringLabelID, int stringMessageID)Set the icon, label and success message for copy url option. BranchShareSheetBuildersetAlias(String alias)Sets the alias for this link. BranchShareSheetBuildersetMatchDuration(int matchDuration)Sets the amount of time that Branch allows a click to remain outstanding. BranchShareSheetBuildersetAsFullWidthStyle(boolean setFullWidthStyle)Sets the share dialog to full width mode. BranchShareSheetBuildersetDialogThemeResourceID(@StyleRes() int styleResourceID)Sets the given resource id as the theme id for share sheet dialog view. BranchShareSheetBuildersetDividerHeight(int height)Set the height for the divider for the sharing channels in the list. BranchShareSheetBuildersetSharingTitle(String title)Set the title for the sharing dialog BranchShareSheetBuildersetSharingTitle(View titleView)Set the title for the sharing dialog BranchShareSheetBuildersetIconSize(int iconSize)Set icon size for the sharing dialog BranchShareSheetBuilderexcludeFromShareSheet(@NonNull() String packageName)Exclude items from the ShareSheet by package name String. BranchShareSheetBuilderexcludeFromShareSheet(@NonNull() Array<String> packageName)Exclude items from the ShareSheet by package name array. BranchShareSheetBuilderexcludeFromShareSheet(@NonNull() List<String> packageNames)Exclude items from the ShareSheet by package name List. BranchShareSheetBuilderincludeInShareSheet(@NonNull() String packageName)Include items from the ShareSheet by package name String. BranchShareSheetBuilderincludeInShareSheet(@NonNull() Array<String> packageName)Include items from the ShareSheet by package name Array. BranchShareSheetBuilderincludeInShareSheet(@NonNull() List<String> packageNames)Include items from the ShareSheet by package name List. voidsetStyleResourceID(@StyleRes() int resourceID)Set the given style to the List View showing the share sheet voidsetShortLinkBuilderInternal(BranchShortLinkBuilder shortLinkBuilder)voidshareLink()Creates an application selector dialog and share a link with user selected sharing option.The link is created with the parameters provided to the builder. ActivitygetActivity()ArrayList<SharingHelper.SHARE_WITH>getPreferredOptions()BranchgetBranch()StringgetShareMsg()StringgetShareSub()Branch.BranchLinkShareListenergetCallback()Branch.IChannelPropertiesgetChannelPropertiesCallback()StringgetDefaultURL()DrawablegetMoreOptionIcon()StringgetMoreOptionText()DrawablegetCopyUrlIcon()StringgetCopyURlText()StringgetUrlCopiedMessage()BranchShortLinkBuildergetShortLinkBuilder()booleangetIsFullWidthStyle()intgetDialogThemeResourceID()intgetDividerHeight()StringgetSharingTitle()ViewgetSharingTitleView()intgetStyleResourceID()intgetIconSize()-
-
Constructor Detail
-
BranchShareSheetBuilder
BranchShareSheetBuilder(Activity activity, JSONObject parameters)
Creates options for sharing a link with other Applications.- Parameters:
activity- The Activity to show the dialog for choosing sharing application.parameters- A JSONObject value containing the deep link params.
-
BranchShareSheetBuilder
BranchShareSheetBuilder(Activity activity, BranchShortLinkBuilder shortLinkBuilder)
*Creates options for sharing a link with other Applications.- Parameters:
activity- The Activity to show the dialog for choosing sharing application.shortLinkBuilder- An instance of BranchShortLinkBuilder to create link to be shared
-
-
Method Detail
-
setMessage
BranchShareSheetBuilder setMessage(String message)
Sets the message to be shared with the link.
- Parameters:
message- A String to be shared with the link
-
setSubject
BranchShareSheetBuilder setSubject(String subject)
Sets the subject of this message. This will be added to Email and SMS Application capable of handling subject in the message.
- Parameters:
subject- A String subject of this message.
-
addTag
BranchShareSheetBuilder addTag(String tag)
Adds the given tag an iterable Collection of String tags associated with a deeplink.
- Parameters:
tag- A String to be added to the iterable Collection of String tags associated with a deeplink.
-
addTags
BranchShareSheetBuilder addTags(ArrayList<String> tags)
Adds the given tag an iterable Collection of String tags associated with a deeplink.
- Parameters:
tags- A java.util.List of tags to be added to the iterable Collection of String tags associated with a deeplink.
-
setFeature
BranchShareSheetBuilder setFeature(String feature)
Adds a feature that make use of the link.
- Parameters:
feature- A String value identifying the feature that the link makes use of.Should not exceed 128 characters.
-
setStage
BranchShareSheetBuilder setStage(String stage)
Adds a stage application or user flow associated with this link.
- Parameters:
stage- A String value identifying the stage in an application or user flowprocess.
-
setCallback
BranchShareSheetBuilder setCallback(Branch.BranchLinkShareListener callback)
Adds a callback to get the sharing status.
- Parameters:
callback- A Branch.BranchLinkShareListener instance for getting sharing status.
-
setChannelProperties
BranchShareSheetBuilder setChannelProperties(Branch.IChannelProperties channelPropertiesCallback)
- Parameters:
channelPropertiesCallback- A io.branch.referral.Branch.IChannelProperties instance for customizing sharing properties for channels.
-
addPreferredSharingOption
BranchShareSheetBuilder addPreferredSharingOption(SharingHelper.SHARE_WITH preferredOption)
Adds application to the preferred list of applications which are shown on share dialog.Only these options will be visible when the application selector dialog launches. Other options can beaccessed by clicking "More"
- Parameters:
preferredOption- A list of applications to be added as preferred options on the app chooser.
-
addPreferredSharingOptions
BranchShareSheetBuilder addPreferredSharingOptions(ArrayList<SharingHelper.SHARE_WITH> preferredOptions)
Adds application to the preferred list of applications which are shown on share dialog.Only these options will be visible when the application selector dialog launches. Other options can beaccessed by clicking "More"
- Parameters:
preferredOptions- A list of applications to be added as preferred options on the app chooser.
-
addParam
BranchShareSheetBuilder addParam(String key, String value)
Add the given key value to the deep link parameters
-
setDefaultURL
BranchShareSheetBuilder setDefaultURL(String url)
Set a default url to share in case there is any error creating the deep link
- Parameters:
url- A String with value of default url to be shared with the selected application in case deep link creation fails.
-
setMoreOptionStyle
BranchShareSheetBuilder setMoreOptionStyle(Drawable icon, String label)
Set the icon and label for the option to expand the application list to see more options.Default label is set to "More"
- Parameters:
icon- Drawable to set as the icon for more option.label- A String with value for the more option label.
-
setMoreOptionStyle
BranchShareSheetBuilder setMoreOptionStyle(int drawableIconID, int stringLabelID)
Set the icon and label for the option to expand the application list to see more options.Default label is set to "More"
- Parameters:
drawableIconID- Resource ID for the drawable to set as the icon for more option.stringLabelID- Resource ID for String label for the more option.
-
setCopyUrlStyle
BranchShareSheetBuilder setCopyUrlStyle(Drawable icon, String label, String message)
Set the icon, label and success message for copy url option. Default label is "Copy link".
-
setCopyUrlStyle
BranchShareSheetBuilder setCopyUrlStyle(int drawableIconID, int stringLabelID, int stringMessageID)
Set the icon, label and success message for copy url option. Default label is "Copy link".
- Parameters:
drawableIconID- Resource ID for the drawable to set as the icon for copy url option.stringLabelID- Resource ID for the string label the copy url option.stringMessageID- Resource ID for the string message to show toast message displayed on copying a url
-
setAlias
BranchShareSheetBuilder setAlias(String alias)
Sets the alias for this link.
- Parameters:
alias- Link 'alias' can be used to label the endpoint on the link.
-
setMatchDuration
BranchShareSheetBuilder setMatchDuration(int matchDuration)
Sets the amount of time that Branch allows a click to remain outstanding.
- Parameters:
matchDuration- A Integer value specifying the time that Branch allows a click toremain outstanding and be eligible to be matched with a new app session.
-
setAsFullWidthStyle
BranchShareSheetBuilder setAsFullWidthStyle(boolean setFullWidthStyle)
Sets the share dialog to full width mode. Full width mode will show a non modal sheet with entire screen width.
- Parameters:
setFullWidthStyle- Boolean With value true if a full width style share sheet is desired.
-
setDialogThemeResourceID
BranchShareSheetBuilder setDialogThemeResourceID(@StyleRes() int styleResourceID)
Sets the given resource id as the theme id for share sheet dialog view.
- Parameters:
styleResourceID- the id of the theme to be applied to the share sheet dialog.
-
setDividerHeight
BranchShareSheetBuilder setDividerHeight(int height)
Set the height for the divider for the sharing channels in the list. Set this to zero to remove the dividers
- Parameters:
height- The new height of the divider in pixels.
-
setSharingTitle
BranchShareSheetBuilder setSharingTitle(String title)
Set the title for the sharing dialog
- Parameters:
title- String containing the value for the title text.
-
setSharingTitle
BranchShareSheetBuilder setSharingTitle(View titleView)
Set the title for the sharing dialog
- Parameters:
titleView- View for setting the title.
-
setIconSize
BranchShareSheetBuilder setIconSize(int iconSize)
Set icon size for the sharing dialog
- Parameters:
iconSize- for setting the share sheet icon size.
-
excludeFromShareSheet
BranchShareSheetBuilder excludeFromShareSheet(@NonNull() String packageName)
Exclude items from the ShareSheet by package name String.
- Parameters:
packageName- String package name to be excluded.
-
excludeFromShareSheet
BranchShareSheetBuilder excludeFromShareSheet(@NonNull() Array<String> packageName)
Exclude items from the ShareSheet by package name array.
- Parameters:
packageName- String package name to be excluded.
-
excludeFromShareSheet
BranchShareSheetBuilder excludeFromShareSheet(@NonNull() List<String> packageNames)
Exclude items from the ShareSheet by package name List.
- Parameters:
packageNames- List package name to be excluded.
-
includeInShareSheet
BranchShareSheetBuilder includeInShareSheet(@NonNull() String packageName)
Include items from the ShareSheet by package name String. If only "com.Slack"is included, then only preferred sharing options + Slackwill be displayed, for example.
- Parameters:
packageName- String package name to be included.
-
includeInShareSheet
BranchShareSheetBuilder includeInShareSheet(@NonNull() Array<String> packageName)
Include items from the ShareSheet by package name Array. If only "com.Slack"is included, then only preferred sharing options + Slackwill be displayed, for example.
- Parameters:
packageName- String package name to be included.
-
includeInShareSheet
BranchShareSheetBuilder includeInShareSheet(@NonNull() List<String> packageNames)
Include items from the ShareSheet by package name List. If only "com.Slack"is included, then only preferred sharing options + Slackwill be displayed, for example.
- Parameters:
packageNames- List package name to be included.
-
setStyleResourceID
void setStyleResourceID(@StyleRes() int resourceID)
Set the given style to the List View showing the share sheet
- Parameters:
resourceID- A Styleable resource to be applied to the share sheet list view
-
setShortLinkBuilderInternal
void setShortLinkBuilderInternal(BranchShortLinkBuilder shortLinkBuilder)
-
shareLink
void shareLink()
Creates an application selector dialog and share a link with user selected sharing option.The link is created with the parameters provided to the builder.
-
getActivity
Activity getActivity()
-
getPreferredOptions
ArrayList<SharingHelper.SHARE_WITH> getPreferredOptions()
-
getBranch
@Deprecated() Branch getBranch()
-
getShareMsg
String getShareMsg()
-
getShareSub
String getShareSub()
-
getCallback
Branch.BranchLinkShareListener getCallback()
-
getChannelPropertiesCallback
Branch.IChannelProperties getChannelPropertiesCallback()
-
getDefaultURL
String getDefaultURL()
-
getMoreOptionIcon
Drawable getMoreOptionIcon()
-
getMoreOptionText
String getMoreOptionText()
-
getCopyUrlIcon
Drawable getCopyUrlIcon()
-
getCopyURlText
String getCopyURlText()
-
getUrlCopiedMessage
String getUrlCopiedMessage()
-
getShortLinkBuilder
BranchShortLinkBuilder getShortLinkBuilder()
-
getIsFullWidthStyle
boolean getIsFullWidthStyle()
-
getDialogThemeResourceID
int getDialogThemeResourceID()
-
getDividerHeight
int getDividerHeight()
-
getSharingTitle
String getSharingTitle()
-
getSharingTitleView
View getSharingTitleView()
-
getStyleResourceID
int getStyleResourceID()
-
getIconSize
int getIconSize()
-
-
-
-