Skip to content

Commit

Permalink
fixing error during initSession() (it was only working the first time…
Browse files Browse the repository at this point in the history
… it was called in the whole application life, see BranchMetrics#653)
  • Loading branch information
fcamblor committed Jun 13, 2022
1 parent 103cfb5 commit 741d45e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/android/io/branch/BranchSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 741d45e

Please sign in to comment.