Skip to content

Commit

Permalink
fix: added $deeplink_path to android
Browse files Browse the repository at this point in the history
  • Loading branch information
Renemari Padillo authored and ethanneff committed Dec 15, 2016
1 parent 2e781f4 commit 6dcb441
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
40 changes: 13 additions & 27 deletions src/android/io/branch/BranchSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ private void getFirstReferringParams(CallbackContext callbackContext) {
*/
private void createBranchUniversalObject(JSONObject options, CallbackContext callbackContext) throws JSONException {


BranchUniversalObject branchObj = new BranchUniversalObject();

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

// Set content visibility
if (options.has("contentIndexingMode")) {

if (options.getString("contentIndexingMode").equals("private")) {
branchObj.setContentIndexingMode(BranchUniversalObject.CONTENT_INDEX_MODE.PRIVATE);
} else {
Expand Down Expand Up @@ -447,6 +445,7 @@ private BranchLinkProperties createLinkProperties(JSONObject options, JSONObject

BranchLinkProperties linkProperties = new BranchLinkProperties();

// Add link properties
if (options.has("feature")) {
linkProperties.setFeature(options.getString("feature"));
}
Expand All @@ -465,39 +464,26 @@ private BranchLinkProperties createLinkProperties(JSONObject options, JSONObject
if (options.has("duration")) {
linkProperties.setDuration(options.getInt("duration"));
}

if (options.has("tags")) {
JSONArray array = (JSONArray) options.get("tags");
if (array != null) {
for (int i=0;i<array.length();i++){
for (int i=0; i<array.length(); i++){
linkProperties.addTag(array.get(i).toString());
}
}
}

if (controlParams.has("$fallback_url")) {
linkProperties.addControlParameter("$fallback_url", controlParams.getString("$fallback_url"));
}
if (controlParams.has("$desktop_url")) {
linkProperties.addControlParameter("$desktop_url", controlParams.getString("$desktop_url"));
}
if (controlParams.has("$android_url")) {
linkProperties.addControlParameter("$android_url", controlParams.getString("$android_url"));
}
if (controlParams.has("$ios_url")) {
linkProperties.addControlParameter("$ios_url", controlParams.getString("$ios_url"));
}
if (controlParams.has("$ipad_url")) {
linkProperties.addControlParameter("$ipad_url", controlParams.getString("$ipad_url"));
}
if (controlParams.has("$fire_url")) {
linkProperties.addControlParameter("$fire_url", controlParams.getString("$fire_url"));
}
if (controlParams.has("$blackberry_url")) {
linkProperties.addControlParameter("$blackberry_url", controlParams.getString("$blackberry_url"));
}
if (controlParams.has("$windows_phone_url")) {
linkProperties.addControlParameter("$windows_phone_url", controlParams.getString("$windows_phone_url"));
Log.d(LCAT, "Adding control parameters:");

// Add and iterate control parameters properties
Iterator<?> keys = controlParams.keys();

while (keys.hasNext()) {
String key = keys.next().toString();

Log.d(LCAT, String.format("key: %s", key));

linkProperties.addControlParameter(key, controlParams.getString(key));
}

return linkProperties;
Expand Down
1 change: 1 addition & 0 deletions testbed/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ function BranchDeepLink() {
$ipad_url: "http://www.example.com/ipad",
more_custom: "data",
even_more_custom: true,
$deeplink_path: "http://deeplink.example.com/testbed",
this_is_custom: 41231,
this_is_date: Date.now()
};
Expand Down

0 comments on commit 6dcb441

Please sign in to comment.