public class BranchRemoteInterface
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BRANCH_KEY |
static int |
NO_BRANCH_KEY_STATUS |
static int |
NO_CONNECTIVITY_STATUS |
protected PrefHelper |
prefHelper_
A
PrefHelper object that is used throughout the class to allow access to read and
write preferences related to the SDK. |
| Constructor and Description |
|---|
BranchRemoteInterface()
Required, but empty constructor method.
|
BranchRemoteInterface(android.content.Context context)
The main constructor of the BranchRemoteInterface class.
|
| Modifier and Type | Method and Description |
|---|---|
ServerResponse |
createCustomUrlSync(org.json.JSONObject post)
Create custom URL, and return the server response for use elsewhere within the app.
|
io.branch.referral.SystemObserver |
getSystemObserver() |
ServerResponse |
make_restful_get(java.lang.String url,
org.json.JSONObject params,
java.lang.String tag,
int timeout)
Make a RESTful GET request, by calling
make_restful_get(String, JSONObject, String, int, int, boolean)
with the logging Boolean parameter pre-populated. |
ServerResponse |
make_restful_post(org.json.JSONObject body,
java.lang.String url,
java.lang.String tag,
int timeout)
Makes a RESTful POST call with logging enabled, without an associated data dictionary;
passed as null.
|
ServerResponse |
make_restful_post(org.json.JSONObject body,
java.lang.String url,
java.lang.String tag,
int timeout,
boolean log)
Makes a RESTful POST call without an associated data dictionary; passed as null.
|
public static final java.lang.String BRANCH_KEY
public static final int NO_CONNECTIVITY_STATUS
public static final int NO_BRANCH_KEY_STATUS
protected PrefHelper prefHelper_
A PrefHelper object that is used throughout the class to allow access to read and
write preferences related to the SDK.
PrefHelperpublic BranchRemoteInterface()
Required, but empty constructor method.
Use BranchRemoteInterface(Context) instead, as it instantiates the class
PrefHelper and SystemObserver handles for the class.
public BranchRemoteInterface(android.content.Context context)
The main constructor of the BranchRemoteInterface class.
context - A Context from which this call was made.public ServerResponse createCustomUrlSync(org.json.JSONObject post)
Create custom URL, and return the server response for use elsewhere within the app.
post - A JSONObject containing post data key-value-pairs.ServerResponse object containing the Branch API response to the
request.public io.branch.referral.SystemObserver getSystemObserver()
public ServerResponse make_restful_get(java.lang.String url, org.json.JSONObject params, java.lang.String tag, int timeout)
Make a RESTful GET request, by calling make_restful_get(String, JSONObject, String, int, int, boolean)
with the logging Boolean parameter pre-populated.
url - A String URL to request from.params - A JSONObject with additional parameters and their values to send with the get request.tag - A String tag for logging/analytics purposes.timeout - An Integer value containing the number of milliseconds to wait
before considering a server request to have timed out.ServerResponse object containing the result of the RESTful request.public ServerResponse make_restful_post(org.json.JSONObject body, java.lang.String url, java.lang.String tag, int timeout)
Makes a RESTful POST call with logging enabled, without an associated data dictionary; passed as null.
body - A JSONObject containing the main data body/payload of the request.url - A String URL to request from.tag - A String tag for logging/analytics purposes.timeout - An Integer value containing the number of milliseconds to wait
before considering a server request to have timed out.ServerResponse object representing the HttpURLConnection
response in Branch SDK terms.public ServerResponse make_restful_post(org.json.JSONObject body, java.lang.String url, java.lang.String tag, int timeout, boolean log)
Makes a RESTful POST call without an associated data dictionary; passed as null.
body - A JSONObject containing the main data body/payload of the request.url - A String URL to request from.tag - A String tag for logging/analytics purposes.timeout - An Integer value containing the number of milliseconds to wait
before considering a server request to have timed out.log - A Boolean value that specifies whether debug logging should be
enabled for this request or not.ServerResponse object representing the HttpURLConnection
response in Branch SDK terms.