public static class Branch.ShareLinkBuilder
extends java.lang.Object
Class for building a share link dialog.This creates a chooser for selecting application for sharing a link created with given parameters.
| Constructor and Description |
|---|
Branch.ShareLinkBuilder(android.app.Activity activity,
BranchShortLinkBuilder shortLinkBuilder)
*
|
Branch.ShareLinkBuilder(android.app.Activity activity,
org.json.JSONObject parameters)
Creates options for sharing a link with other Applications.
|
| Modifier and Type | Method and Description |
|---|---|
Branch.ShareLinkBuilder |
addParam(java.lang.String key,
java.lang.String value)
Add the given key value to the deep link parameters
|
Branch.ShareLinkBuilder |
addPreferredSharingOption(SharingHelper.SHARE_WITH preferredOption)
Adds application to the preferred list of applications which are shown on share dialog.
|
Branch.ShareLinkBuilder |
addPreferredSharingOptions(java.util.ArrayList<SharingHelper.SHARE_WITH> preferredOptions)
Adds application to the preferred list of applications which are shown on share dialog.
|
Branch.ShareLinkBuilder |
addTag(java.lang.String tag)
Adds the given tag an iterable
Collection of String tags associated with a deep
link. |
Branch.ShareLinkBuilder |
addTags(java.util.ArrayList<java.lang.String> tags)
Adds the given tag an iterable
Collection of String tags associated with a deep
link. |
android.app.Activity |
getActivity() |
Branch |
getBranch() |
Branch.BranchLinkShareListener |
getCallback() |
Branch.IChannelProperties |
getChannelPropertiesCallback() |
android.graphics.drawable.Drawable |
getCopyUrlIcon() |
java.lang.String |
getCopyURlText() |
java.lang.String |
getDefaultURL() |
android.graphics.drawable.Drawable |
getMoreOptionIcon() |
java.lang.String |
getMoreOptionText() |
java.util.ArrayList<SharingHelper.SHARE_WITH> |
getPreferredOptions() |
java.lang.String |
getShareMsg() |
java.lang.String |
getShareSub() |
BranchShortLinkBuilder |
getShortLinkBuilder() |
int |
getStyleResourceID() |
java.lang.String |
getUrlCopiedMessage() |
Branch.ShareLinkBuilder |
setAlias(java.lang.String alias)
Sets the alias for this link.
|
Branch.ShareLinkBuilder |
setCallback(Branch.BranchLinkShareListener callback)
Adds a callback to get the sharing status.
|
Branch.ShareLinkBuilder |
setChannelProperties(Branch.IChannelProperties channelPropertiesCallback) |
Branch.ShareLinkBuilder |
setCopyUrlStyle(android.graphics.drawable.Drawable icon,
java.lang.String label,
java.lang.String message)
Set the icon, label and success message for copy url option.
|
Branch.ShareLinkBuilder |
setCopyUrlStyle(int drawableIconID,
int stringLabelID,
int stringMessageID)
Set the icon, label and success message for copy url option.
|
Branch.ShareLinkBuilder |
setDefaultURL(java.lang.String url)
Set a default url to share in case there is any error creating the deep link
|
Branch.ShareLinkBuilder |
setFeature(java.lang.String feature)
Adds a feature that make use of the link.
|
Branch.ShareLinkBuilder |
setMatchDuration(int matchDuration)
Sets the amount of time that Branch allows a click to remain outstanding.
|
Branch.ShareLinkBuilder |
setMessage(java.lang.String message)
Sets the message to be shared with the link.
|
Branch.ShareLinkBuilder |
setMoreOptionStyle(android.graphics.drawable.Drawable icon,
java.lang.String label)
Set the icon and label for the option to expand the application list to see more options.
|
Branch.ShareLinkBuilder |
setMoreOptionStyle(int drawableIconID,
int stringLabelID)
Set the icon and label for the option to expand the application list to see more options.
|
void |
setShortLinkBuilderInternal(BranchShortLinkBuilder shortLinkBuilder) |
Branch.ShareLinkBuilder |
setStage(java.lang.String stage)
Adds a stage application or user flow associated with this link.
|
void |
setStyleResourceID(int resourceID)
Set the given style to the List View showing the share sheet
|
Branch.ShareLinkBuilder |
setSubject(java.lang.String subject)
Sets the subject of this message.
|
void |
shareLink()
Creates an application selector dialog and share a link with user selected sharing option.
|
public Branch.ShareLinkBuilder(android.app.Activity activity,
org.json.JSONObject parameters)
Creates options for sharing a link with other Applications. Creates a builder for sharing the link with user selected clients
activity - The Activity to show the dialog for choosing sharing application.parameters - @param params A JSONObject value containing the deep link params.public Branch.ShareLinkBuilder(android.app.Activity activity,
BranchShortLinkBuilder shortLinkBuilder)
Creates options for sharing a link with other Applications. Creates a builder for sharing the link with user selected clients
activity - The Activity to show the dialog for choosing sharing application.shortLinkBuilder - An instance of BranchShortLinkBuilder to create link to be sharedpublic Branch.ShareLinkBuilder setMessage(java.lang.String message)
Sets the message to be shared with the link.
message - A String to be shared with the linkBranch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setSubject(java.lang.String subject)
Sets the subject of this message. This will be added to Email and SMS Application capable of handling subject in the message.
subject - A String subject of this message.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder addTag(java.lang.String tag)
Adds the given tag an iterable Collection of String tags associated with a deep
link.
tag - A String to be added to the iterable Collection of String tags associated with a deep
link.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder addTags(java.util.ArrayList<java.lang.String> tags)
Adds the given tag an iterable Collection of String tags associated with a deep
link.
tags - A List of tags to be added to the iterable Collection of String tags associated with a deep
link.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setFeature(java.lang.String feature)
Adds a feature that make use of the link.
feature - A String value identifying the feature that the link makes use of.
Should not exceed 128 characters.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setStage(java.lang.String stage)
Adds a stage application or user flow associated with this link.
stage - A String value identifying the stage in an application or user flow
process. Should not exceed 128 characters.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setCallback(Branch.BranchLinkShareListener callback)
Adds a callback to get the sharing status.
callback - A Branch.BranchLinkShareListener instance for getting sharing status.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setChannelProperties(Branch.IChannelProperties channelPropertiesCallback)
channelPropertiesCallback - A Branch.IChannelProperties instance for customizing sharing properties for channels.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder 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 be accessed by clicking "More"
preferredOption - A list of applications to be added as preferred options on the app chooser.
Preferred applications are defined in SharingHelper.SHARE_WITH.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder addPreferredSharingOptions(java.util.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 be accessed by clicking "More"
preferredOptions - A list of applications to be added as preferred options on the app chooser.
Preferred applications are defined in SharingHelper.SHARE_WITH.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder addParam(java.lang.String key, java.lang.String value)
key - A String with value for the key for the deep link paramsvalue - A String with deep link parameters valueBranch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setDefaultURL(java.lang.String url)
Set a default url to share in case there is any error creating the deep link
url - A String with value of default url to be shared with the selected application in case deep link creation fails.Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setMoreOptionStyle(android.graphics.drawable.Drawable icon, java.lang.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"
icon - Drawable to set as the icon for more option. Default icon is system menu_more icon.label - A String with value for the more option label. Default label is "More"Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder 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"
drawableIconID - Resource ID for the drawable to set as the icon for more option. Default icon is system menu_more icon.stringLabelID - Resource ID for String label for the more option. Default label is "More"Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setCopyUrlStyle(android.graphics.drawable.Drawable icon, java.lang.String label, java.lang.String message)
Set the icon, label and success message for copy url option. Default label is "Copy link".
icon - Drawable to set as the icon for copy url option. Default icon is system menu_save iconlabel - A String with value for the copy url option label. Default label is "Copy link"message - A String with value for a toast message displayed on copying a url.
Default message is "Copied link to clipboard!"Branch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setCopyUrlStyle(int drawableIconID, int stringLabelID, int stringMessageID)
Set the icon, label and success message for copy url option. Default label is "Copy link".
drawableIconID - Resource ID for the drawable to set as the icon for copy url option. Default icon is system menu_save iconstringLabelID - Resource ID for the string label the copy url option. Default label is "Copy link"stringMessageID - Resource ID for the string message to show toast message displayed on copying a urlBranch.ShareLinkBuilder instance.public Branch.ShareLinkBuilder setAlias(java.lang.String alias)
Sets the alias for this link.
alias - Link 'alias' can be used to label the endpoint on the link.
For example: http://bnc.lt/AUSTIN28. Should not exceed 128 characters
public Branch.ShareLinkBuilder setMatchDuration(int matchDuration)
Sets the amount of time that Branch allows a click to remain outstanding.
matchDuration - A Integer value specifying the time that Branch allows a click to
remain outstanding and be eligible to be matched with a new app session.public void setStyleResourceID(int resourceID)
Set the given style to the List View showing the share sheet
resourceID - A Styleable resource to be applied to the share sheet list viewpublic void setShortLinkBuilderInternal(BranchShortLinkBuilder shortLinkBuilder)
public 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.
public android.app.Activity getActivity()
public java.util.ArrayList<SharingHelper.SHARE_WITH> getPreferredOptions()
public Branch getBranch()
public java.lang.String getShareMsg()
public java.lang.String getShareSub()
public Branch.BranchLinkShareListener getCallback()
public Branch.IChannelProperties getChannelPropertiesCallback()
public java.lang.String getDefaultURL()
public android.graphics.drawable.Drawable getMoreOptionIcon()
public java.lang.String getMoreOptionText()
public android.graphics.drawable.Drawable getCopyUrlIcon()
public java.lang.String getCopyURlText()
public java.lang.String getUrlCopiedMessage()
public BranchShortLinkBuilder getShortLinkBuilder()
public int getStyleResourceID()