@@ -350,7 +350,6 @@ private void getFirstReferringParams(CallbackContext callbackContext) {
350
350
*/
351
351
private void createBranchUniversalObject (JSONObject options , CallbackContext callbackContext ) throws JSONException {
352
352
353
-
354
353
BranchUniversalObject branchObj = new BranchUniversalObject ();
355
354
356
355
// Set object properties
@@ -373,7 +372,6 @@ private void createBranchUniversalObject(JSONObject options, CallbackContext cal
373
372
374
373
// Set content visibility
375
374
if (options .has ("contentIndexingMode" )) {
376
-
377
375
if (options .getString ("contentIndexingMode" ).equals ("private" )) {
378
376
branchObj .setContentIndexingMode (BranchUniversalObject .CONTENT_INDEX_MODE .PRIVATE );
379
377
} else {
@@ -447,6 +445,7 @@ private BranchLinkProperties createLinkProperties(JSONObject options, JSONObject
447
445
448
446
BranchLinkProperties linkProperties = new BranchLinkProperties ();
449
447
448
+ // Add link properties
450
449
if (options .has ("feature" )) {
451
450
linkProperties .setFeature (options .getString ("feature" ));
452
451
}
@@ -465,39 +464,26 @@ private BranchLinkProperties createLinkProperties(JSONObject options, JSONObject
465
464
if (options .has ("duration" )) {
466
465
linkProperties .setDuration (options .getInt ("duration" ));
467
466
}
468
-
469
467
if (options .has ("tags" )) {
470
468
JSONArray array = (JSONArray ) options .get ("tags" );
471
469
if (array != null ) {
472
- for (int i =0 ;i <array .length ();i ++){
470
+ for (int i =0 ; i <array .length (); i ++){
473
471
linkProperties .addTag (array .get (i ).toString ());
474
472
}
475
473
}
476
474
}
477
475
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 ));
501
487
}
502
488
503
489
return linkProperties ;
0 commit comments