Skip to content

Commit

Permalink
Merge pull request #604 from BranchMetrics/Staging
Browse files Browse the repository at this point in the history
RC 2.19.3
  • Loading branch information
Aaron Lopez authored Aug 27, 2018
2 parents 2bdb8c5 + 09fd4fc commit dbb8d8e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
Binary file renamed Branch-2.19.2.jar → Branch-2.19.3.jar
Binary file not shown.
Binary file renamed Branch-2.19.2_core.jar → Branch-2.19.3_core.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fabric-identifier=io.branch.sdk.android.library
fabric-version=2.19.2
fabric-version=2.19.3
fabric-build-type=source
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ private BranchResponse doRestfulPost(String url, JSONObject payload, int retryNu

outputStreamWriter.write(payload.toString());
outputStreamWriter.flush();
outputStreamWriter.close();

int responseCode = connection.getResponseCode();
if (responseCode >= HttpsURLConnection.HTTP_INTERNAL_ERROR
Expand All @@ -149,16 +150,26 @@ private BranchResponse doRestfulPost(String url, JSONObject payload, int retryNu
retryNumber++;
return doRestfulPost(url, payload, retryNumber);
} else {
InputStream inputStream = null;
try {
if (responseCode != HttpsURLConnection.HTTP_OK && connection.getErrorStream() != null) {
return new BranchResponse(getResponseString(connection.getErrorStream()), responseCode);
inputStream = connection.getErrorStream();
} else {
return new BranchResponse(getResponseString(connection.getInputStream()), responseCode);
inputStream = connection.getInputStream();
}
return new BranchResponse(getResponseString(inputStream), responseCode);
} catch (FileNotFoundException ex) {
// In case of Resource conflict getInputStream will throw FileNotFoundException. Handle it here in order to send the right status code
PrefHelper.Debug("BranchSDK", "A resource conflict occurred with this request " + url);
return new BranchResponse(null, responseCode);
} finally {
try {
if (inputStream != null) {
inputStream.close();
}
} catch(IOException e) {
e.printStackTrace();
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion Branch-SDK/src/io/branch/referral/util/BranchEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ private BranchEvent(String eventName, boolean isStandardEvent) {
this.eventName = eventName;

for (BRANCH_STANDARD_EVENT event : BRANCH_STANDARD_EVENT.values()) {
if (eventName == event.getName()) {
if (eventName.equals(event.getName())) {
isStandardEvent = true;
break;
}
}

Expand Down
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Branch Android SDK change log

- v2.19.3
* _*Master Release*_ - August 22, 2018
* Changed post request logic to close streams. [#600](https://github.com/BranchMetrics/android-branch-deep-linking/issues/600)
* Added check for if `BranchEvent` is same name as `BRANCH_STANDARD_EVENT` name, send with `v2/event/standard` request. DEVEX-751

- v2.19.2
* _*Master Release*_ - August 10, 2018
* Added notify network API to process requests when network is available. DEVEX-711
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=2.19.2
VERSION_NAME=2.19.3
VERSION_CODE=1
GROUP=io.branch.sdk.android

Expand Down

0 comments on commit dbb8d8e

Please sign in to comment.