Skip to content

Commit 4e36ede

Browse files
Merge pull request #709 from BranchMetrics/Staging
Release v3.2.0
2 parents e3bee2c + 90db3c2 commit 4e36ede

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

Branch-SDK/src/io/branch/referral/Branch.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,8 +2318,8 @@ private void processNextQueueItem() {
23182318
networkCount_ = 0;
23192319
handleFailure(requestQueue_.getSize() - 1, BranchError.ERR_NO_SESSION);
23202320
}
2321-
//All request except open and install need a session to execute
2322-
else if (!(req instanceof ServerRequestInitSession) && (!hasSession() || !hasDeviceFingerPrint())) {
2321+
// Determine if a session is needed to execute (SDK-271)
2322+
else if (requestNeedsSession(req) && !isSessionAvailableForRequest()) {
23232323
networkCount_ = 0;
23242324
handleFailure(requestQueue_.getSize() - 1, BranchError.ERR_NO_SESSION);
23252325
} else {
@@ -2339,6 +2339,23 @@ else if (!(req instanceof ServerRequestInitSession) && (!hasSession() || !hasDev
23392339
e.printStackTrace();
23402340
}
23412341
}
2342+
2343+
// Determine if a Request needs a Session to proceed.
2344+
private boolean requestNeedsSession(ServerRequest request) {
2345+
if (request instanceof ServerRequestInitSession) {
2346+
return false;
2347+
} else if (request instanceof ServerRequestCreateUrl) {
2348+
return false;
2349+
}
2350+
2351+
// All other Request Types need a session.
2352+
return true;
2353+
}
2354+
2355+
// Determine if a Session is available for a Request to proceed.
2356+
private boolean isSessionAvailableForRequest() {
2357+
return (hasSession() && hasDeviceFingerPrint());
2358+
}
23422359

23432360
private void handleFailure(int index, int statusCode) {
23442361
ServerRequest req;
@@ -2565,7 +2582,7 @@ public void onStrongMatchCheckFinished() {
25652582
*/
25662583
public void handleNewRequest(ServerRequest req) {
25672584
// If Tracking is disabled fail all messages with ERR_BRANCH_TRACKING_DISABLED
2568-
if (trackingController.isTrackingDisabled()) {
2585+
if (trackingController.isTrackingDisabled() && !req.prepareExecuteWithoutTracking()) {
25692586
req.reportTrackingDisabledError();
25702587
return;
25712588
}

Branch-SDK/src/io/branch/referral/ServerRequestCreateUrl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,11 @@ private void updateShareEventToFabric(String url) {
273273
boolean isPersistable() {
274274
return false; // No need to retrieve create url request from previous session
275275
}
276+
277+
@Override
278+
protected boolean prepareExecuteWithoutTracking() {
279+
// SDK-271 -- Allow creation of short links when tracking is disabled.
280+
return true;
281+
}
282+
276283
}

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Branch Android SDK change log
2+
- v3.2.0
3+
* _*Master Release*_ - May 2, 2019
4+
* SDK-271 Allow short link creation while privacy is enabled
5+
26
- v3.1.2
37
* _*Master Release*_ - April 16, 2019
48
* Hardware ID is now included in every request

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=3.1.2
2-
VERSION_CODE=030102
1+
VERSION_NAME=3.2.0
2+
VERSION_CODE=030200
33
GROUP=io.branch.sdk.android
44

55
POM_DESCRIPTION=Use the Branch SDK (branch.io) to create and power the links that point back to your apps for all of these things and more. Branch makes it incredibly simple to create powerful deep links that can pass data across app install and open while handling all edge cases (using on desktop vs. mobile vs. already having the app installed, etc). Best of all, it is really simple to start using the links for your own app: only 2 lines of code to register the deep link router and one more line of code to create the links with custom data.

0 commit comments

Comments
 (0)