Skip to content

Commit 14ed28b

Browse files
author
Aaron Lopez
authored
Merge pull request #598 from BranchMetrics/Staging
Staging
2 parents c287149 + 3861ebe commit 14ed28b

File tree

8 files changed

+73
-8
lines changed

8 files changed

+73
-8
lines changed
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fabric-identifier=io.branch.sdk.android.library
2-
fabric-version=2.19.1
2+
fabric-version=2.19.2
33
fabric-build-type=source

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,13 +2454,22 @@ public void handleNewRequest(ServerRequest req) {
24542454
}
24552455
}
24562456
}
2457-
2458-
requestQueue_.enqueue(req);
2459-
req.onRequestQueued();
2457+
2458+
if (!(req instanceof ServerRequestPing)) {
2459+
requestQueue_.enqueue(req);
2460+
req.onRequestQueued();
2461+
}
24602462
processNextQueueItem();
24612463
}
2462-
2463-
2464+
2465+
/**
2466+
* Notify Branch when network is available in order to process the next request in the queue.
2467+
*/
2468+
public void notifyNetworkAvailable() {
2469+
ServerRequest req = new ServerRequestPing(context_);
2470+
handleNewRequest(req);
2471+
}
2472+
24642473
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
24652474
private void setActivityLifeCycleObserver(Application application) {
24662475
try {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public abstract class ServerRequest {
2626

2727
private static final String POST_KEY = "REQ_POST";
2828
private static final String POST_PATH_KEY = "REQ_POST_PATH";
29-
29+
3030
private JSONObject params_;
3131
protected String requestPath_;
3232
protected final PrefHelper prefHelper_;
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package io.branch.referral;
2+
3+
import android.app.Application;
4+
import android.content.Context;
5+
import android.util.Log;
6+
7+
/**
8+
* * <p>
9+
* The server request for pinging the API to process the queue.
10+
* </p>
11+
*/
12+
public class ServerRequestPing extends ServerRequest {
13+
14+
/**
15+
* <p>Configures a server request to process the request queue.</p>
16+
*
17+
* @param context Current {@link Application} context
18+
*/
19+
public ServerRequestPing(Context context) {
20+
super(context, null);
21+
}
22+
23+
@Override
24+
public boolean handleErrors(Context context) {
25+
if (!super.doesAppHasInternetPermission(context)) {
26+
PrefHelper.Debug("BranchSDK", "Trouble executing your request. Please add 'android.permission.INTERNET' in your applications manifest file");
27+
return true;
28+
}
29+
return false;
30+
}
31+
32+
@Override
33+
public void onRequestSucceeded(ServerResponse response, Branch branch) {
34+
//No implementation on purpose
35+
}
36+
37+
@Override
38+
public void handleFailure(int statusCode, String causeMsg) {
39+
//No implementation on purpose
40+
}
41+
42+
@Override
43+
public boolean isGetRequest() {
44+
return false;
45+
}
46+
47+
@Override
48+
public void clearCallbacks() {
49+
//No implementation on purpose
50+
}
51+
}

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
Branch Android SDK change log
2+
3+
- v2.19.2
4+
* _*Master Release*_ - August 10, 2018
5+
* Added notify network API to process requests when network is available. DEVEX-711
6+
27
- v2.19.1 [09-AUG-18] Fixed GAID fetch issue.
38

49
- v2.19.0 [03-JUL-18] Support for adding custom install metadata. Fix for an ANR in debug mode. Fix for crash caused by reading user agent. SDK Integration validator.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=2.19.1
1+
VERSION_NAME=2.19.2
22
VERSION_CODE=1
33
GROUP=io.branch.sdk.android
44

0 commit comments

Comments
 (0)