I'm using Branch.io
for sharing content from my app. I think it has a good interface, but I'm in a situation where I would like to share different message texts for different cases. For example, I'd like to have a certain text for e-mail and a certain text for SMS. I use the following code (As provided by the documentation here):
private void shareWithBranchSheet() {
ShareSheetStyle shareSheetStyle = new ShareSheetStyle(SessionDetailActivity.this, "", getShareMessage())
.setDefaultURL(getShareUrl())
.addPreferredSharingOption(SharingHelper.SHARE_WITH.EMAIL)
.addPreferredSharingOption(SharingHelper.SHARE_WITH.FACEBOOK)
.addPreferredSharingOption(SharingHelper.SHARE_WITH.MESSAGE);
getBranchUniversalObject().showShareSheet(MyShareActivity.this, getLinkProperties(), shareSheetStyle, new Branch.BranchLinkShareListener() {
@Override
public void onShareLinkDialogLaunched() {
}
@Override
public void onShareLinkDialogDismissed() {
}
@Override
public void onLinkShareResponse(String sharedLink, String sharedChannel, BranchError error) {
}
@Override
public void onChannelSelected(String channelName) {
}
});
}
private BranchUniversalObject getBranchUniversalObject() {
BranchUniversalObject branchUniversalObject = new BranchUniversalObject();
branchUniversalObject.setTitle(getMyTitle());
branchUniversalObject.setContentDescription(getMyDescription());
branchUniversalObject.setContentImageUrl(getMyImageUrl());
branchUniversalObject.addContentMetadata("param1", getDataForParam("1"));
return branchUniversalObject;
}
private LinkProperties getLinkProperties() {
io.branch.referral.util.LinkProperties linkProperties = new io.branch.referral.util.LinkProperties();
linkProperties = linkProperties.setFeature("sharing");
linkProperties = linkProperties.setChannel("Messages");
return linkProperties;
}
Now the problem I have is that there is only one kind of text I can use in the ShareSheetStyle
for whatever option I choose. I want to change the text for Email and SMS, and the callbacks are no good for this since the share content is already set at this point.
Is there anyone who knows how I can change the text according to my selection? Any help is appreciated.