Skip to content

Commit 5e1f9f6

Browse files
Params bugfixes
Params bugfixes
1 parent 93296e6 commit 5e1f9f6

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Branch-SDK/src/main/java/io/branch/referral/validators/LinkingValidatorDialog.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,10 @@ void LoadStep2Screen() {
117117
case CANONICAL_URL:
118118
linkingValidatorEditText.setVisibility(View.VISIBLE);
119119
linkingValidatorText.setText(LinkingValidatorConstants.canonicalURLPromptText);
120-
routingKey = LinkingValidatorConstants.canonicalUrlKey;
121-
routingValue = linkingValidatorEditText.getText().toString();
122120
break;
123121
case DEEPLINK_PATH:
124122
linkingValidatorEditText.setVisibility(View.VISIBLE);
125123
linkingValidatorText.setText(LinkingValidatorConstants.deeplinkPathPromptText);
126-
routingKey = LinkingValidatorConstants.deeplinkPathKey;
127-
routingValue = linkingValidatorEditText.getText().toString();
128124
break;
129125
case CUSTOM:
130126
customKVPField.setVisibility(View.VISIBLE);
@@ -134,6 +130,17 @@ void LoadStep2Screen() {
134130
}
135131

136132
void GenerateBranchLinks() {
133+
switch(routingType) {
134+
case CANONICAL_URL:
135+
routingKey = LinkingValidatorConstants.canonicalUrlKey;
136+
routingValue = linkingValidatorEditText.getText().toString();
137+
break;
138+
case DEEPLINK_PATH:
139+
routingKey = LinkingValidatorConstants.deeplinkPathKey;
140+
routingValue = linkingValidatorEditText.getText().toString();
141+
break;
142+
}
143+
137144
step++;
138145
linkingValidatorEditText.setVisibility(View.GONE);
139146
customKVPField.setVisibility(View.GONE);

Branch-SDK/src/main/java/io/branch/referral/validators/LinkingValidatorDialogRowItem.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public void InitializeRow(String title, String infoText, String debugText, Strin
6868
linkDataParams.put(params[i], params[i + 1]);
6969
}
7070

71+
linkDataParams.put(routingKey, routingValue);
72+
7173
infoButton.setOnClickListener(view1 -> {
7274
HandleInfoButtonClicked();
7375
});
@@ -140,6 +142,10 @@ private void HandleWarmStartClick() {
140142
private void HandleForegroundLinkClick() {
141143
BranchUniversalObject buo = new BranchUniversalObject().setCanonicalIdentifier(canonicalIdentifier);
142144
LinkProperties lp = new LinkProperties();
145+
lp.addControlParameter(routingKey, routingValue);
146+
for (int i = 0; i < linkDataParams.size(); i += 2) {
147+
lp.addControlParameter(linkDataParams.get(i), linkDataParams.get(i + 1));
148+
}
143149
String branchLink = buo.getShortUrl(context, lp);
144150
Intent intent = new Intent(getContext(), getActivity(context).getClass());
145151
intent.putExtra("branch", branchLink);

0 commit comments

Comments
 (0)