@@ -115,7 +115,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
115115 } else if (action .equals ("initSession" )) {
116116 cordova .getActivity ().runOnUiThread (r );
117117 return true ;
118- } else if (action .equals ("setMixpanelToken " )) {
118+ } else if (action .equals ("setRequestMetadata " )) {
119119 cordova .getActivity ().runOnUiThread (r );
120120 return true ;
121121 } else {
@@ -611,9 +611,9 @@ private void setIdentity(String newIdentity, CallbackContext callbackContext) {
611611 * @param token A {@link String} value containing the unique identifier of the Mixpanel user.
612612 * @param callbackContext A callback to execute at the end of this method
613613 */
614- private void setMixpanelToken (String token , CallbackContext callbackContext ) {
614+ private void setRequestMetadata (String key , String val , CallbackContext callbackContext ) {
615615
616- Branch .getInstance ().setRequestMetadata ("$mixpanel_distinct_id" , token );
616+ Branch .getInstance ().setRequestMetadata (key , val );
617617
618618 callbackContext .success ("Success" );
619619
@@ -1258,8 +1258,8 @@ public void run() {
12581258 setDebug (this .args .getBoolean (0 ), this .callbackContext );
12591259 } else if (this .action .equals ("initSession" )) {
12601260 initSession (this .callbackContext );
1261- } else if (this .action .equals ("setMixpanelToken " )) {
1262- setMixpanelToken (this .args .getString (0 ), this .callbackContext );
1261+ } else if (this .action .equals ("setRequestMetadata " )) {
1262+ setRequestMetadata (this .args .getString (0 ), this . args . getString ( 1 ), this .callbackContext );
12631263 } else {
12641264 if (this .action .equals ("setIdentity" )) {
12651265 setIdentity (this .args .getString (0 ), this .callbackContext );
0 commit comments