diff --git a/src/android/io/branch/BranchSDK.java b/src/android/io/branch/BranchSDK.java index 97dddfd8..bf9e3255 100644 --- a/src/android/io/branch/BranchSDK.java +++ b/src/android/io/branch/BranchSDK.java @@ -867,14 +867,18 @@ public void onInitFinished(JSONObject referringParams, BranchError error) { this._callbackContext.success(referringParams); } } else { - JSONObject message = new JSONObject(); - try { - message.put("error", error.getMessage()); - } catch (JSONException e) { - e.printStackTrace(); - } - if (this._callbackContext != null) { - this._callbackContext.error(message); + if (error.getErrorCode() == BranchError.ERR_BRANCH_ALREADY_INITIALIZED) { + getLatestReferringParams(this._callbackContext); + } else { + JSONObject message = new JSONObject(); + try { + message.put("error", error.getMessage()); + } catch (JSONException e) { + e.printStackTrace(); + } + if (this._callbackContext != null) { + this._callbackContext.error(message); + } } }