Skip to content

Commit 6dcb441

Browse files
Renemari Padilloethanneff
authored andcommitted
fix: added $deeplink_path to android
1 parent 2e781f4 commit 6dcb441

File tree

2 files changed

+14
-27
lines changed

2 files changed

+14
-27
lines changed

src/android/io/branch/BranchSDK.java

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ private void getFirstReferringParams(CallbackContext callbackContext) {
350350
*/
351351
private void createBranchUniversalObject(JSONObject options, CallbackContext callbackContext) throws JSONException {
352352

353-
354353
BranchUniversalObject branchObj = new BranchUniversalObject();
355354

356355
// Set object properties
@@ -373,7 +372,6 @@ private void createBranchUniversalObject(JSONObject options, CallbackContext cal
373372

374373
// Set content visibility
375374
if (options.has("contentIndexingMode")) {
376-
377375
if (options.getString("contentIndexingMode").equals("private")) {
378376
branchObj.setContentIndexingMode(BranchUniversalObject.CONTENT_INDEX_MODE.PRIVATE);
379377
} else {
@@ -447,6 +445,7 @@ private BranchLinkProperties createLinkProperties(JSONObject options, JSONObject
447445

448446
BranchLinkProperties linkProperties = new BranchLinkProperties();
449447

448+
// Add link properties
450449
if (options.has("feature")) {
451450
linkProperties.setFeature(options.getString("feature"));
452451
}
@@ -465,39 +464,26 @@ private BranchLinkProperties createLinkProperties(JSONObject options, JSONObject
465464
if (options.has("duration")) {
466465
linkProperties.setDuration(options.getInt("duration"));
467466
}
468-
469467
if (options.has("tags")) {
470468
JSONArray array = (JSONArray) options.get("tags");
471469
if (array != null) {
472-
for (int i=0;i<array.length();i++){
470+
for (int i=0; i<array.length(); i++){
473471
linkProperties.addTag(array.get(i).toString());
474472
}
475473
}
476474
}
477475

478-
if (controlParams.has("$fallback_url")) {
479-
linkProperties.addControlParameter("$fallback_url", controlParams.getString("$fallback_url"));
480-
}
481-
if (controlParams.has("$desktop_url")) {
482-
linkProperties.addControlParameter("$desktop_url", controlParams.getString("$desktop_url"));
483-
}
484-
if (controlParams.has("$android_url")) {
485-
linkProperties.addControlParameter("$android_url", controlParams.getString("$android_url"));
486-
}
487-
if (controlParams.has("$ios_url")) {
488-
linkProperties.addControlParameter("$ios_url", controlParams.getString("$ios_url"));
489-
}
490-
if (controlParams.has("$ipad_url")) {
491-
linkProperties.addControlParameter("$ipad_url", controlParams.getString("$ipad_url"));
492-
}
493-
if (controlParams.has("$fire_url")) {
494-
linkProperties.addControlParameter("$fire_url", controlParams.getString("$fire_url"));
495-
}
496-
if (controlParams.has("$blackberry_url")) {
497-
linkProperties.addControlParameter("$blackberry_url", controlParams.getString("$blackberry_url"));
498-
}
499-
if (controlParams.has("$windows_phone_url")) {
500-
linkProperties.addControlParameter("$windows_phone_url", controlParams.getString("$windows_phone_url"));
476+
Log.d(LCAT, "Adding control parameters:");
477+
478+
// Add and iterate control parameters properties
479+
Iterator<?> keys = controlParams.keys();
480+
481+
while (keys.hasNext()) {
482+
String key = keys.next().toString();
483+
484+
Log.d(LCAT, String.format("key: %s", key));
485+
486+
linkProperties.addControlParameter(key, controlParams.getString(key));
501487
}
502488

503489
return linkProperties;

testbed/www/js/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ function BranchDeepLink() {
184184
$ipad_url: "http://www.example.com/ipad",
185185
more_custom: "data",
186186
even_more_custom: true,
187+
$deeplink_path: "http://deeplink.example.com/testbed",
187188
this_is_custom: 41231,
188189
this_is_date: Date.now()
189190
};

0 commit comments

Comments
 (0)