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 |
|---|---|
void |
connectToDebug()
Connect to server debug endpoint.
|
ServerResponse |
createCustomUrlSync(org.json.JSONObject post)
Create custom URL, and return the server response for use elsewhere within the app.
|
void |
disconnectFromDebug()
Disconnect from the server debug interface.
|
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.
|
ServerResponse |
make_restful_post(org.json.JSONObject body,
java.lang.String url,
java.lang.String tag,
int timeout,
io.branch.referral.BranchLinkData linkData)
Makes a RESTful POST call with logging enabled.
|
void |
sendLog(java.lang.String log)
Log messages to the server's debug interface.
|
void |
setNetworkCallbackListener(io.branch.referral.NetworkCallback callback)
Sets a callback listener to handle network events received during this app session.
|
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 void setNetworkCallbackListener(io.branch.referral.NetworkCallback callback)
Sets a callback listener to handle network events received during this app session.
callback - A NetworkCallback object instance that will be triggered for
each network event that occurs during this app session.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 void connectToDebug()
Connect to server debug endpoint.
public void disconnectFromDebug()
Disconnect from the server debug interface.
public void sendLog(java.lang.String log)
Log messages to the server's debug interface.
log - A String variable containing information to log.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, io.branch.referral.BranchLinkData linkData)
Makes a RESTful POST call with logging enabled.
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.linkData - A BranchLinkData object containing the data dictionary associated
with the link subject of the original server request.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.