@@ -781,6 +781,20 @@ private void sendCommerceEvent(JSONObject action, JSONObject metaData, CallbackC
781
781
782
782
}
783
783
784
+ public void sendBranchEvent (String eventName , CallbackContext callbackContext ) throws JSONException {
785
+
786
+ BranchEvent event ;
787
+ try {
788
+ BRANCH_STANDARD_EVENT standardEvent = BRANCH_STANDARD_EVENT .valueOf (eventName );
789
+ event = new BranchEvent (standardEvent );
790
+ } catch (IllegalArgumentException e ) {
791
+ event = new BranchEvent (eventName );
792
+ }
793
+
794
+ event .logEvent (this .activity );
795
+ //callbackContext.success();
796
+ }
797
+
784
798
public void sendBranchEvent (String eventName , JSONObject metaData , CallbackContext callbackContext ) throws JSONException {
785
799
786
800
BranchEvent event ;
@@ -1422,7 +1436,11 @@ public void run() {
1422
1436
} else if (this .action .equals ("sendCommerceEvent" )) {
1423
1437
sendCommerceEvent (this .args .getJSONObject (0 ), this .args .getJSONObject (1 ), this .callbackContext );
1424
1438
} else if (this .action .equals ("sendBranchEvent" )) {
1425
- sendBranchEvent (this .args .getString (0 ), this .args .getJSONObject (1 ), this .callbackContext );
1439
+ if (this .args .length () == 2 ) {
1440
+ sendBranchEvent (this .args .getString (0 ), this .args .getJSONObject (1 ), this .callbackContext );
1441
+ } else if (this .args .length () == 1 ) {
1442
+ sendBranchEvent (this .args .getString (0 ), this .callbackContext );
1443
+ }
1426
1444
} else if (this .action .equals ("getFirstReferringParams" )) {
1427
1445
getFirstReferringParams (this .callbackContext );
1428
1446
} else if (this .action .equals ("getLatestReferringParams" )) {
0 commit comments