-
public class BranchShortLinkBuilder extends BranchUrlBuilder<BranchShortLinkBuilder>
Class for creating builder for getting a short url with Branch. This builder provide an easy and flexible way to configure and create a short url Synchronously or asynchronously.
-
-
Constructor Summary
Constructors Constructor Description BranchShortLinkBuilder(Context context)
-
Method Summary
Modifier and Type Method Description BranchShortLinkBuildersetAlias(String alias)Sets the alias for this link. BranchShortLinkBuildersetChannel(String channel)Sets the channel for this link. BranchShortLinkBuildersetDuration(int duration)Sets the amount of time that Branch allows a click to remain outstanding. BranchShortLinkBuildersetFeature(String feature)Set a name that identifies the feature that the link makes use of. BranchShortLinkBuildersetParameters(JSONObject parameters)Set the parameters associated with the link. BranchShortLinkBuildersetStage(String stage)Set a name that identify the stage in an application or user flow process. BranchShortLinkBuildersetCampaign(String campaign)Sets the campaign that the link belongs to. BranchShortLinkBuildersetType(int type)Sets an that can be used for scenarios where you want the link toonly deep link the first time or unlimited times StringgetShortUrl()Configures and requests a short URL to be generated by the Branch servers, via a synchronouscall; with a duration specified within which an app session should be matched to the link. voidgenerateShortUrl(Branch.BranchLinkCreateListener callback)Configures and requests a short URL to be generated by the Branch servers, via a asynchronouscall; The Branch.BranchLinkCreateListener is called back with the url when the url is generated. -
-
Constructor Detail
-
BranchShortLinkBuilder
BranchShortLinkBuilder(Context context)
-
-
Method Detail
-
setAlias
BranchShortLinkBuilder setAlias(String alias)
Sets the alias for this link.
- Parameters:
alias- Link 'alias' can be used to label the endpoint on the link.
-
setChannel
BranchShortLinkBuilder setChannel(String channel)
Sets the channel for this link.
- Parameters:
channel- A String denoting the channel that the link belongs to.
-
setDuration
BranchShortLinkBuilder setDuration(int duration)
Sets the amount of time that Branch allows a click to remain outstanding.
- Parameters:
duration- A Integer value specifying the time that Branch allows a click toremain outstanding and be eligible to be matched with a new app session.
-
setFeature
BranchShortLinkBuilder setFeature(String feature)
Set a name that identifies the feature that the link makes use of.
- Parameters:
feature- A String value identifying the feature that the link makes use of.Should not exceed 128 characters.
-
setParameters
BranchShortLinkBuilder setParameters(JSONObject parameters)
Set the parameters associated with the link.
- Parameters:
parameters- A JSONObject value containing the deep linked params associated withthe link that will be passed into a new app session when clicked.
-
setStage
BranchShortLinkBuilder setStage(String stage)
Set a name that identify the stage in an application or user flow process.
- Parameters:
stage- A String value identifying the stage in an application or user flowprocess.
-
setCampaign
BranchShortLinkBuilder setCampaign(String campaign)
Sets the campaign that the link belongs to.
- Parameters:
campaign- A String denoting the campaign that the link belongs to.
-
setType
BranchShortLinkBuilder setType(int type)
Sets an that can be used for scenarios where you want the link toonly deep link the first time or unlimited times
- Parameters:
type- that can be used for scenarios where you want the link toonly deep link the first time.
-
getShortUrl
String getShortUrl()
Configures and requests a short URL to be generated by the Branch servers, via a synchronouscall; with a duration specified within which an app session should be matched to the link.
-
generateShortUrl
void generateShortUrl(Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers, via a asynchronouscall; The Branch.BranchLinkCreateListener is called back with the url when the url is generated.
- Parameters:
callback- A Branch.BranchLinkCreateListener callback instance that will trigger
-
-
-
-