public class Branch
extends java.lang.Object
The core object required when using Branch SDK. You should declare an object of this type at the class-level of each Activity or Fragment that you wish to use Branch functionality within.
Normal instantiation of this object would look like this:
Branch.getInstance(this.getApplicationContext()) // from an Activity Branch.getInstance(getActivity().getApplicationContext()) // from a Fragment
| Modifier and Type | Class and Description |
|---|---|
class |
Branch.BranchApplyReferralCodeError
BranchError class containing the message to display in logs when calls have been
made to apply a referral code, but the Branch object has not been properly initialised or
cannot contact the server due to a network connectivity issue. |
class |
Branch.BranchCreateUrlError
BranchError class containing the message to display in logs when a Branch referral
URL could not be created. |
class |
Branch.BranchDuplicateReferralCodeError
BranchError class containing the message to display in logs where the same
referral code has been applied already, potentially identifying an erroneously repeated
code block or poorly implemented loop. |
class |
Branch.BranchDuplicateUrlError
BranchError class containing the message to display in logs where an alias request
has been submitted that has different parameters attached. |
class |
Branch.BranchGetCreditHistoryError
BranchError class containing the message to display in logs where a request to the
server to fetch a user's credit history has failed due to poor connectivity or an internal
system error. |
class |
Branch.BranchGetCreditsError
BranchError class containing the message to display in logs where a request to the
server to fetch a user's current credit balance has failed due to poor connectivity or an internal
system error. |
class |
Branch.BranchGetReferralCodeError
BranchError class containing the message to display in logs where the referral
code has not been received properly by the server. |
class |
Branch.BranchGetReferralsError
BranchError class containing the message to display in logs where a request to the
server to fetch the current referral count has failed due to poor connectivity or an internal
system error. |
class |
Branch.BranchInitError
BranchError class containing the message to display in logs where the Branch
initialisation process has failed due to poor connectivity, or because the App Key in use in
the current application is misconfigured. |
class |
Branch.BranchInvalidReferralCodeError
BranchError class containing the message to display in logs where the
referral code is invalid, suggesting an implementation error in handling generated codes, or
input validation failure where the code is input manually by the user. |
static interface |
Branch.BranchLinkCreateListener
An Interface class that is implemented by all classes that make use of
Branch.BranchLinkCreateListener , defining a single method that takes a URL
String format, and an error message of BranchError format that will be
returned on failure of the request response. |
static interface |
Branch.BranchListResponseListener
An Interface class that is implemented by all classes that make use of
Branch.BranchListResponseListener , defining a single method that takes a list of
JSONArray format, and an error message of BranchError format that will be
returned on failure of the request response. |
class |
Branch.BranchNotInitError
BranchError class containing the message to display in logs for when calls have
been made to a Branch object when a connection has not been established. |
static interface |
Branch.BranchReferralInitListener
An Interface class that is implemented by all classes that make use of
Branch.BranchReferralInitListener , defining a single method that takes a list of params in
JSONObject format, and an error message of BranchError format that will be
returned on failure of the request response. |
static interface |
Branch.BranchReferralStateChangedListener
An Interface class that is implemented by all classes that make use of
Branch.BranchReferralStateChangedListener , defining a single method that takes a value of
Boolean format, and an error message of BranchError format that will be
returned on failure of the request response. |
class |
Branch.BranchSetIdentityError
BranchError class containing the message to display in logs in cases where the
user alias cannot be set. |
class |
Branch.BranchValidateReferralCodeError
BranchError class containing the message to display in logs where the referral
code cannot be validated due to a lack of communication, or valid response from, the Branch
server. |
static class |
Branch.CreditHistoryOrder
enum class containing the sort options for return of credit history. |
class |
Branch.ReferralNetworkCallback
A class that implements
NetworkCallback interface and provides the required state
and response logic for the process of interacting with the Branch referral network service. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALWAYS_DEEPLINK
String value indicating whether the link should always initiate a deep link action. |
static java.lang.String |
DEEPLINK_PATH
String value denoting the deep link path that an app can receive; for Android, this
is handled by a custom IntentFilter . |
static java.lang.String |
FEATURE_TAG_DEAL
Hard-coded
String that denotes a link that is part of a commercial 'deal' or offer. |
static java.lang.String |
FEATURE_TAG_GIFT
Hard-coded
String that denotes a link tagged as a gift action within a service or
product. |
static java.lang.String |
FEATURE_TAG_INVITE
Hard-coded
String that denotes a 'referral' tag; applies to links that are sent as
referral actions by users of an app using an 'invite contacts' feature for instance. |
static java.lang.String |
FEATURE_TAG_REFERRAL
Hard-coded
String that denotes a 'referral' tag; applies to links that are sent as
referral actions from other services or sites. |
static java.lang.String |
FEATURE_TAG_SHARE
Hard-coded
String that denotes a BranchLinkData.tags ; applies to links that
are shared with others directly as a user action, via social media for instance. |
static int |
LINK_TYPE_ONE_TIME_USE
An
Integer value indicating the link type. |
static int |
LINK_TYPE_UNLIMITED_USE
An
Integer value indicating the link type. |
static java.lang.String |
OG_APP_ID
Unique identifier for the app in use.
|
static java.lang.String |
OG_DESC
The type of your object, e.g., "video.movie".
|
static java.lang.String |
OG_IMAGE_URL
An image URL which should represent your object within the graph.
|
static java.lang.String |
OG_TITLE
Open Graph: The title of your object as it should appear within the graph, e.g., "The Rock".
|
static java.lang.String |
OG_URL
The canonical URL of your object that will be used as its permanent ID in the graph.
|
static java.lang.String |
OG_VIDEO
A URL to a video file that complements this object.
|
static java.lang.String |
REDEEM_CODE
The code to be passed as part of a deal or gift; retrieved from the Branch object as a
tag upon initialisation.
|
static java.lang.String |
REDIRECT_ANDROID_URL
The redirect URL provided when the link is handled by an Android device.
|
static java.lang.String |
REDIRECT_BLACKBERRY_URL
The redirect URL provided when the link is handled by a Blackberry device.
|
static java.lang.String |
REDIRECT_DESKTOP_URL
The redirect URL provided when the link is handled by a desktop client.
|
static java.lang.String |
REDIRECT_FIRE_URL
The redirect URL provided when the link is handled by an Amazon Fire device.
|
static java.lang.String |
REDIRECT_IOS_URL
The redirect URL provided when the link is handled by an iOS device.
|
static java.lang.String |
REDIRECT_IPAD_URL
The redirect URL provided when the link is handled by a large form-factor iOS device such as
an iPad.
|
static java.lang.String |
REDIRECT_WINDOWS_PHONE_URL
The redirect URL provided when the link is handled by a Windows Phone device.
|
static java.lang.String |
REFERRAL_BUCKET_DEFAULT
Default value of referral bucket; referral buckets contain credits that are used when users
are referred to your apps.
|
static java.lang.String |
REFERRAL_CODE
Key value for referral code as a parameter.
|
static int |
REFERRAL_CODE_AWARD_UNIQUE
An
Integer value indicating the calculation type of the referral code. |
static int |
REFERRAL_CODE_AWARD_UNLIMITED
An
Integer value indicating the calculation type of the referral code. |
static int |
REFERRAL_CODE_LOCATION_BOTH
An
Integer value indicating the user to reward for applying a referral code. |
static int |
REFERRAL_CODE_LOCATION_REFERREE
An
Integer value indicating the user to reward for applying a referral code. |
static int |
REFERRAL_CODE_LOCATION_REFERRING_USER
An
Integer value indicating the user to reward for applying a referral code. |
static java.lang.String |
REFERRAL_CODE_TYPE
Hard-coded value for referral code type.
|
static int |
REFERRAL_CREATION_SOURCE_SDK
Branch SDK version for the current release of the Branch SDK.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyReferralCode(java.lang.String code,
Branch.BranchReferralInitListener callback)
Applies a supplied referral code to the current user session upon initialisation.
|
void |
closeSession()
Closes the current session, dependent on the state of the
PrefHelper.getSmartSession() Boolean value. |
void |
disableAppList()
Calls the
disableExternAppListing() on the local instance to prevent
a list of installed Apps from being returned to the Branch API. |
void |
disableSmartSession()
If there's further Branch API call happening within the two seconds, we then don't close
the session; otherwise, we close the session after two seconds.
|
void |
getContentUrl(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a content URL to be generated by the Branch servers.
|
void |
getContentUrl(java.lang.String channel,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a content URL to be generated by the Branch servers.
|
java.lang.String |
getContentUrlSync(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
JSONObject params)
Configures and requests a content URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getContentUrlSync(java.lang.String channel,
JSONObject params)
Configures and requests a content URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
void |
getCreditHistory(Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the
response.
|
void |
getCreditHistory(java.lang.String bucket,
Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the
response.
|
void |
getCreditHistory(java.lang.String afterId,
int length,
Branch.CreditHistoryOrder order,
Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the
response.
|
void |
getCreditHistory(java.lang.String bucket,
java.lang.String afterId,
int length,
Branch.CreditHistoryOrder order,
Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the
response.
|
int |
getCredits()
Retrieve the number of credits available for the "default" bucket.
|
int |
getCreditsForBucket(java.lang.String bucket)
Returns an
Integer of the number of credits available for use within the supplied
bucket name. |
JSONObject |
getFirstReferringParams()
Queries the local
PrefHelper instance to get the initial assigned install parameters
as a String, then converts the string into a JSONObject for server sync or to be
passed to another class. |
static Branch |
getInstance(Context context)
Singleton method to return the pre-initialised, or newly initialise and return, a singleton
object of the type
Branch . |
static Branch |
getInstance(Context context,
java.lang.String key)
Deprecated.
|
JSONObject |
getLatestReferringParams()
Queries the local
PrefHelper instance to get the current assigned session parameters
as a String, then converts the string into a JSONObject for server sync or to be
passed to another class. |
void |
getReferralCode(Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
|
void |
getReferralCode(int amount,
Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
|
void |
getReferralCode(int amount,
java.util.Date expiration,
Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
|
void |
getReferralCode(java.lang.String prefix,
int amount,
Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
|
void |
getReferralCode(java.lang.String prefix,
int amount,
java.util.Date expiration,
Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
|
void |
getReferralCode(java.lang.String prefix,
int amount,
java.util.Date expiration,
java.lang.String bucket,
int calculationType,
int location,
Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
|
void |
getReferralCode(java.lang.String prefix,
int amount,
int calculationType,
int location,
Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
|
void |
getReferralUrl(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a referral URL to be generated by the Branch servers.
|
void |
getReferralUrl(java.lang.String channel,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a referral URL to be generated by the Branch servers.
|
java.lang.String |
getReferralUrlSync(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
JSONObject params)
Configures and requests a referral URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getReferralUrlSync(java.lang.String channel,
JSONObject params)
Configures and requests a referral URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
void |
getShortUrl(Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
int duration,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(int type,
java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(int type,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(java.lang.String alias,
java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
int duration,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
void |
getShortUrl(java.lang.String alias,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
|
java.lang.String |
getShortUrlSync()
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
int duration)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(int type,
java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(int type,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(java.lang.String alias,
java.util.Collection<java.lang.String> tags,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params,
int duration)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
java.lang.String |
getShortUrlSync(java.lang.String alias,
java.lang.String channel,
java.lang.String feature,
java.lang.String stage,
JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous
call; with a duration specified within which an app session should be matched to the link.
|
int |
getTotalCountsForAction(java.lang.String action)
Gets the total number of times that the specified action has been carried out.
|
int |
getUniqueCountsForAction(java.lang.String action)
Gets the number of unique times that the specified action has been carried out.
|
boolean |
initSession()
Initialises a session with the Branch API, without a callback or
Activity . |
boolean |
initSession(Activity activity)
Initialises a session with the Branch API, without a callback or
Activity . |
boolean |
initSession(boolean isReferrable,
Activity activity)
Initialises a session with the Branch API, specifying whether the initialisation can count
as a referrable action, and supplying the calling
Activity for context. |
boolean |
initSession(Branch.BranchReferralInitListener callback)
Initialises a session with the Branch API, assigning a
Branch.BranchReferralInitListener
to perform an action upon successful initialisation. |
boolean |
initSession(Branch.BranchReferralInitListener callback,
Activity activity)
Initialises a session with the Branch API, passing the
Activity and assigning a
Branch.BranchReferralInitListener to perform an action upon successful initialisation. |
boolean |
initSession(Branch.BranchReferralInitListener callback,
boolean isReferrable,
Activity activity)
Initialises a session with the Branch API.
|
boolean |
initSession(Branch.BranchReferralInitListener callback,
boolean isReferrable,
Uri data)
Initialises a session with the Branch API.
|
boolean |
initSession(Branch.BranchReferralInitListener callback,
boolean isReferrable,
Uri data,
Activity activity)
Initialises a session with the Branch API.
|
boolean |
initSession(Branch.BranchReferralInitListener callback,
Uri data)
Initialises a session with the Branch API.
|
boolean |
initSession(Branch.BranchReferralInitListener callback,
Uri data,
Activity activity)
Initialises a session with the Branch API.
|
boolean |
initSessionWithData(Uri data)
Initialises a session with the Branch API, with associated data from the supplied
Uri . |
boolean |
initSessionWithData(Uri data,
Activity activity)
Initialises a session with the Branch API, with associated data from the supplied
Uri . |
void |
loadActionCounts()
Fire-and-forget retrieval of action count for the current session.
|
void |
loadActionCounts(Branch.BranchReferralStateChangedListener callback)
Gets the total action count, with a callback to perform a predefined
action following successful report of state change.
|
void |
loadRewards()
Fire-and-forget retrieval of rewards for the current session.
|
void |
loadRewards(Branch.BranchReferralStateChangedListener callback)
Retrieves rewards for the current session, with a callback to perform a predefined
action following successful report of state change.
|
void |
logout()
Closes the current session asynchronously.
|
boolean |
readAndStripParam(Uri data,
Activity activity)
Reads and (if successful) removes the parameter from the data
Uri . |
void |
redeemRewards(int count)
Redeems the specified number of credits from the "default" bucket, if there are sufficient
credits within it.
|
void |
redeemRewards(java.lang.String bucket,
int count)
Redeems the specified number of credits from the named bucket, if there are sufficient
credits within it.
|
void |
resetUserSession()
Manually sets the
Boolean value, that indicates that the Branch API connection has
been initialised, to false - forcing re-initialisation. |
void |
setDebug()
Sets the library to function in debug mode.
|
void |
setIdentity(java.lang.String userId)
Identifies the current user to the Branch API by supplying a unique identifier as a
String value. |
void |
setIdentity(java.lang.String userId,
Branch.BranchReferralInitListener callback)
Identifies the current user to the Branch API by supplying a unique identifier as a
String value, with a callback specified to perform a defined action upon successful
response to request. |
void |
setNetworkTimeout(int timeout)
Sets the duration in milliseconds that the system should wait for a response before considering
any Branch API call to have timed out.
|
void |
setRetryCount(int retryCount)
Sets the number of times to re-attempt a timed-out request to the Branch API, before
considering the request to have failed entirely.
|
void |
setRetryInterval(int retryInterval)
Sets the amount of time in milliseconds to wait before re-attempting a timed-out request
to the Branch API.
|
void |
userCompletedAction(java.lang.String action)
A void call to indicate that the user has performed a specific action and for that to be
reported to the Branch API.
|
void |
userCompletedAction(java.lang.String action,
JSONObject metadata)
A void call to indicate that the user has performed a specific action and for that to be
reported to the Branch API, with additional app-defined meta data to go along with that action.
|
void |
validateReferralCode(java.lang.String code,
Branch.BranchReferralInitListener callback)
Validates the supplied referral code on initialisation without applying it to the current
session.
|
public static final java.lang.String FEATURE_TAG_SHARE
String
that denotes a BranchLinkData.tags
; applies to links that
are shared with others directly as a user action, via social media for instance.public static final java.lang.String FEATURE_TAG_REFERRAL
String
that denotes a 'referral' tag; applies to links that are sent as
referral actions from other services or sites.public static final java.lang.String FEATURE_TAG_INVITE
String
that denotes a 'referral' tag; applies to links that are sent as
referral actions by users of an app using an 'invite contacts' feature for instance.public static final java.lang.String FEATURE_TAG_DEAL
String
that denotes a link that is part of a commercial 'deal' or offer.public static final java.lang.String FEATURE_TAG_GIFT
String
that denotes a link tagged as a gift action within a service or
product.public static final java.lang.String REDEEM_CODE
String
format.public static final java.lang.String REFERRAL_BUCKET_DEFAULT
Default value of referral bucket; referral buckets contain credits that are used when users are referred to your apps. These can be viewed in the Branch dashboard under Referrals.
public static final java.lang.String REFERRAL_CODE_TYPE
Hard-coded value for referral code type. Referral codes will always result on "credit" actions. Even if they are of 0 value.
public static final int REFERRAL_CREATION_SOURCE_SDK
public static final java.lang.String REFERRAL_CODE
public static final java.lang.String REDIRECT_DESKTOP_URL
public static final java.lang.String REDIRECT_ANDROID_URL
public static final java.lang.String REDIRECT_IOS_URL
public static final java.lang.String REDIRECT_IPAD_URL
public static final java.lang.String REDIRECT_FIRE_URL
public static final java.lang.String REDIRECT_BLACKBERRY_URL
public static final java.lang.String REDIRECT_WINDOWS_PHONE_URL
public static final java.lang.String OG_TITLE
public static final java.lang.String OG_DESC
public static final java.lang.String OG_IMAGE_URL
public static final java.lang.String OG_VIDEO
public static final java.lang.String OG_URL
public static final java.lang.String OG_APP_ID
public static final java.lang.String DEEPLINK_PATH
String
value denoting the deep link path that an app can receive; for Android, this
is handled by a custom IntentFilter
.public static final java.lang.String ALWAYS_DEEPLINK
String
value indicating whether the link should always initiate a deep link action.public static final int REFERRAL_CODE_LOCATION_REFERREE
Integer
value indicating the user to reward for applying a referral code. In this
case, the user applying the referral code receives credit.public static final int REFERRAL_CODE_LOCATION_REFERRING_USER
Integer
value indicating the user to reward for applying a referral code. In this
case, the user who created the referral code receives credit.public static final int REFERRAL_CODE_LOCATION_BOTH
Integer
value indicating the user to reward for applying a referral code. In this
case, both the creator and applicant receive creditpublic static final int REFERRAL_CODE_AWARD_UNLIMITED
Integer
value indicating the calculation type of the referral code. In this case,
the referral code can be applied continually.public static final int REFERRAL_CODE_AWARD_UNIQUE
Integer
value indicating the calculation type of the referral code. In this case,
a user can only apply a specific referral code once.public static final int LINK_TYPE_UNLIMITED_USE
Integer
value indicating the link type. In this case, the link can be used an
unlimited number of times.public static final int LINK_TYPE_ONE_TIME_USE
Integer
value indicating the link type. In this case, the link can be used only
once. After initial use, subsequent attempts will not validate.@Deprecated public static Branch getInstance(Context context, java.lang.String key)
Singleton method to return the pre-initialised, or newly initialise and return, a singleton
object of the type Branch
.
Deprecated - use getInstance(Context)
instead; the Branch key should be
declared in XML rather than hard-coded into your Java code going forward.
context
- A Context
from which this call was made.key
- Your Branch app key as a String
.Branch
object, either fetched from a pre-initialised
instance within the singleton class, or a newly instantiated object where
one was not already requested during the current app lifecycle.public static Branch getInstance(Context context)
Singleton method to return the pre-initialised, or newly initialise and return, a singleton
object of the type Branch
.
Use this whenever you need to call a method directly on the Branch
object.
context
- A Context
from which this call was made.Branch
object, either fetched from a pre-initialised
instance within the singleton class, or a newly instantiated object where
one was not already requested during the current app lifecycle.public void resetUserSession()
Manually sets the Boolean
value, that indicates that the Branch API connection has
been initialised, to false - forcing re-initialisation.
public void setRetryCount(int retryCount)
Sets the number of times to re-attempt a timed-out request to the Branch API, before considering the request to have failed entirely.
retryCount
- An Integer
specifying the number of times to retry before giving
up and declaring defeat.public void setRetryInterval(int retryInterval)
Sets the amount of time in milliseconds to wait before re-attempting a timed-out request to the Branch API.
retryInterval
- An Integer
value specifying the number of milliseconds to
wait before re-attempting a timed-out request.public void setNetworkTimeout(int timeout)
Sets the duration in milliseconds that the system should wait for a response before considering any Branch API call to have timed out.
Increase this to perform better in low network speed situations, but at the expense of responsiveness to error situation.
timeout
- An Integer
value specifying the number of milliseconds to wait before
considering the request to have timed out.public void setDebug()
Sets the library to function in debug mode.
If you want to flag debug, call this before initUserSession
public void disableAppList()
Calls the disableExternAppListing()
on the local instance to prevent
a list of installed Apps from being returned to the Branch API.
public void disableSmartSession()
If there's further Branch API call happening within the two seconds, we then don't close the session; otherwise, we close the session after two seconds.
Call this method if you don't want this smart session feature.
Note: smart session - we keep session alive for two seconds
public boolean initSession(Branch.BranchReferralInitListener callback)
Initialises a session with the Branch API, assigning a Branch.BranchReferralInitListener
to perform an action upon successful initialisation.
callback
- A Branch.BranchReferralInitListener
instance that will be called following
successful (or unsuccessful) initialisation of the session with the Branch API.Boolean
value, indicating false if initialisation is
unsuccessful.public boolean initSession(Branch.BranchReferralInitListener callback, Activity activity)
Initialises a session with the Branch API, passing the Activity
and assigning a
Branch.BranchReferralInitListener
to perform an action upon successful initialisation.
callback
- A Branch.BranchReferralInitListener
instance that will be called
following successful (or unsuccessful) initialisation of the session
with the Branch API.activity
- The calling Activity
for context.Boolean
value, indicating false if initialisation is
unsuccessful.public boolean initSession(Branch.BranchReferralInitListener callback, Uri data)
Initialises a session with the Branch API.
callback
- A Branch.BranchReferralInitListener
instance that will be called
following successful (or unsuccessful) initialisation of the session
with the Branch API.data
- A Uri
variable containing the details of the source link that
led to this initialisation action.Boolean
value that will return false if the supplied
data parameter cannot be handled successfully - i.e. is not of a
valid URI format.public boolean initSession(Branch.BranchReferralInitListener callback, Uri data, Activity activity)
Initialises a session with the Branch API.
callback
- A Branch.BranchReferralInitListener
instance that will be called
following successful (or unsuccessful) initialisation of the session
with the Branch API.data
- A Uri
variable containing the details of the source link that
led to this initialisation action.activity
- The calling Activity
for context.Boolean
value that will return false if the supplied
data parameter cannot be handled successfully - i.e. is not of a
valid URI format.public boolean initSession()
Initialises a session with the Branch API, without a callback or Activity
.
Boolean
value that returns false if unsuccessful.public boolean initSession(Activity activity)
Initialises a session with the Branch API, without a callback or Activity
.
activity
- The calling Activity
for context.Boolean
value that returns false if unsuccessful.public boolean initSessionWithData(Uri data)
Initialises a session with the Branch API, with associated data from the supplied
Uri
.
data
- A Uri
variable containing the details of the source link that
led to this
initialisation action.Boolean
value that returns false if unsuccessful.public boolean initSessionWithData(Uri data, Activity activity)
Initialises a session with the Branch API, with associated data from the supplied
Uri
.
data
- A Uri
variable containing the details of the source link that led to this
initialisation action.activity
- The calling Activity
for context.Boolean
value that returns false if unsuccessful.public boolean initSession(boolean isReferrable, Activity activity)
Initialises a session with the Branch API, specifying whether the initialisation can count
as a referrable action, and supplying the calling Activity
for context.
isReferrable
- A Boolean
value indicating whether this initialisation
session should be considered as potentially referrable or a
non-referred, manual launch action.activity
- The calling Activity
for context.Boolean
value that returns false if unsuccessful.public boolean initSession(Branch.BranchReferralInitListener callback, boolean isReferrable, Uri data)
Initialises a session with the Branch API.
callback
- A Branch.BranchReferralInitListener
instance that will be called
following successful (or unsuccessful) initialisation of the session
with the Branch API.isReferrable
- A Boolean
value indicating whether this initialisation session
should be considered as potentially referrable or a non-referred, manual
launch action.data
- A Uri
variable containing the details of the source link that
led to this initialisation action.Boolean
value that returns false if unsuccessful.public boolean initSession(Branch.BranchReferralInitListener callback, boolean isReferrable, Uri data, Activity activity)
Initialises a session with the Branch API.
callback
- A Branch.BranchReferralInitListener
instance that will be called
following successful (or unsuccessful) initialisation of the session
with the Branch API.isReferrable
- A Boolean
value indicating whether this initialisation session
should be considered as potentially referrable or a non-referred, manual
launch action.data
- A Uri
variable containing the details of the source link that
led to this initialisation action.activity
- The calling Activity
for context.Boolean
value that returns false if unsuccessful.public boolean initSession(Branch.BranchReferralInitListener callback, boolean isReferrable, Activity activity)
Initialises a session with the Branch API.
callback
- A Branch.BranchReferralInitListener
instance that will be called
following successful (or unsuccessful) initialisation of the session
with the Branch API.isReferrable
- A Boolean
value indicating whether this initialisation session
should be considered as potentially referrable or a non-referred, manual
launch action.activity
- The calling Activity
for context.Boolean
value that returns false if unsuccessful.public void closeSession()
Closes the current session, dependent on the state of the
PrefHelper.getSmartSession()
Boolean
value. If true, take no action.
If false, close the sesion via the executeClose()
method.
public boolean readAndStripParam(Uri data, Activity activity)
Reads and (if successful) removes the parameter from the data Uri
.
link_click_id = the Link Click Identifier; a way for Branch to know 100% that a user was deep linked from a particular link click.
data
- A Uri
containing the supplied link, with associated parameters.activity
- A Activity
object, from which this method was called.Boolean
value indicating whether the action was successful;
Uri
, and removed.Uri
was not altered. Either the supplied Uri
was null, the
supplied data was not hierarchical, or link_click_id was null.public void setIdentity(java.lang.String userId, Branch.BranchReferralInitListener callback)
Identifies the current user to the Branch API by supplying a unique identifier as a
String
value, with a callback specified to perform a defined action upon successful
response to request.
userId
- A String
value containing the unique identifier of the user.callback
- A Branch.BranchReferralInitListener
callback instance that will
trigger actions defined therein upon a referral state change.public void setIdentity(java.lang.String userId)
Identifies the current user to the Branch API by supplying a unique identifier as a
String
value. No callback.
userId
- A String
value containing the unique identifier of the user.public void logout()
Closes the current session asynchronously.
public void loadActionCounts()
Fire-and-forget retrieval of action count for the current session. Without a callback.
public void loadActionCounts(Branch.BranchReferralStateChangedListener callback)
Gets the total action count, with a callback to perform a predefined action following successful report of state change.
callback
- A Branch.BranchReferralStateChangedListener
callback instance that will
trigger actions defined therein upon a referral state change.public void loadRewards()
Fire-and-forget retrieval of rewards for the current session. Without a callback.
public void loadRewards(Branch.BranchReferralStateChangedListener callback)
Retrieves rewards for the current session, with a callback to perform a predefined action following successful report of state change.
callback
- A Branch.BranchReferralStateChangedListener
callback instance that will
trigger actions defined therein upon a referral state change.public int getCredits()
Retrieve the number of credits available for the "default" bucket.
Integer
value of the number credits available in the "default" bucket.public int getCreditsForBucket(java.lang.String bucket)
Integer
of the number of credits available for use within the supplied
bucket name.bucket
- A String
value indicating the name of the bucket to get credits for.Integer
value of the number credits available in the specified
bucket.public int getTotalCountsForAction(java.lang.String action)
Gets the total number of times that the specified action has been carried out.
action
- A String
value containing the name of the action to count.Integer
value of the total number of times that an action has
been executed.public int getUniqueCountsForAction(java.lang.String action)
Gets the number of unique times that the specified action has been carried out.
action
- A String
value containing the name of the action to count.Integer
value of the number of unique times that the
specified action has been carried out.public void redeemRewards(int count)
Redeems the specified number of credits from the "default" bucket, if there are sufficient credits within it. If the number to redeem exceeds the number available in the bucket, all of the available credits will be redeemed instead.
count
- A Integer
specifying the number of credits to attempt to redeem from
the bucket.public void redeemRewards(java.lang.String bucket, int count)
Redeems the specified number of credits from the named bucket, if there are sufficient credits within it. If the number to redeem exceeds the number available in the bucket, all of the available credits will be redeemed instead.
bucket
- A String
value containing the name of the referral bucket to attempt
to redeem credits from.count
- A Integer
specifying the number of credits to attempt to redeem from
the specified bucket.public void getCreditHistory(Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the response.
callback
- A Branch.BranchListResponseListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.public void getCreditHistory(java.lang.String bucket, Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the response.
bucket
- A String
value containing the name of the referral bucket that the
code will belong to.callback
- A Branch.BranchListResponseListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.public void getCreditHistory(java.lang.String afterId, int length, Branch.CreditHistoryOrder order, Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the response.
afterId
- A String
value containing the ID of the history record to begin after.
This allows for a partial history to be retrieved, rather than the entire
credit history of the bucket.length
- A Integer
value containing the number of credit history records to
return.order
- A Branch.CreditHistoryOrder
object indicating which order the results should
be returned in.
Valid choices:
callback
- A Branch.BranchListResponseListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.public void getCreditHistory(java.lang.String bucket, java.lang.String afterId, int length, Branch.CreditHistoryOrder order, Branch.BranchListResponseListener callback)
Gets the credit history of the specified bucket and triggers a callback to handle the response.
bucket
- A String
value containing the name of the referral bucket that the
code will belong to.afterId
- A String
value containing the ID of the history record to begin after.
This allows for a partial history to be retrieved, rather than the entire
credit history of the bucket.length
- A Integer
value containing the number of credit history records to
return.order
- A Branch.CreditHistoryOrder
object indicating which order the results should
be returned in.
Valid choices:
callback
- A Branch.BranchListResponseListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.public void userCompletedAction(java.lang.String action, JSONObject metadata)
A void call to indicate that the user has performed a specific action and for that to be reported to the Branch API, with additional app-defined meta data to go along with that action.
action
- A String
value to be passed as an action that the user has carried
out. For example "registered" or "logged in".metadata
- A JSONObject
containing app-defined meta-data to be attached to a
user action that has just been completed.public void userCompletedAction(java.lang.String action)
A void call to indicate that the user has performed a specific action and for that to be reported to the Branch API.
action
- A String
value to be passed as an action that the user has carried
out. For example "registered" or "logged in".public JSONObject getFirstReferringParams()
Queries the local PrefHelper
instance to get the initial assigned install parameters
as a String, then converts the string into a JSONObject
for server sync or to be
passed to another class.
JSONObject
containing the install-time parameters as configured
locally.public JSONObject getLatestReferringParams()
Queries the local PrefHelper
instance to get the current assigned session parameters
as a String, then converts the string into a JSONObject
for server sync or to be
passed to another class.
JSONObject
containing the latest referring parameters as
configured locally.public java.lang.String getShortUrlSync()
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
String
containing the resulting short URL.public java.lang.String getShortUrlSync(JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
params
- A JSONObject
value containing the deep linked params associated with the
link that the user is to follow.String
containing the resulting short URL.public java.lang.String getReferralUrlSync(java.lang.String channel, JSONObject params)
Configures and requests a referral URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting referral URL.public java.lang.String getReferralUrlSync(java.util.Collection<java.lang.String> tags, java.lang.String channel, JSONObject params)
Configures and requests a referral URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting referral URL.public java.lang.String getContentUrlSync(java.lang.String channel, JSONObject params)
Configures and requests a content URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting content URL.public java.lang.String getContentUrlSync(java.util.Collection<java.lang.String> tags, java.lang.String channel, JSONObject params)
Configures and requests a content URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting content URL.public java.lang.String getShortUrlSync(java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow process.
Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with the
link that the user is to follow.String
containing the resulting short URL.public java.lang.String getShortUrlSync(java.lang.String alias, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
alias
- Link 'alias' can be used to label the endpoint on the link.
For example: http://bnc.lt/AUSTIN28. Should not exceed 128 characters
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting short URL.public java.lang.String getShortUrlSync(int type, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
type
- An int
that can be used for scenarios where you want the link to
only deep link the first time.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting short URL.public java.lang.String getShortUrlSync(java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, int duration)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.duration
- A Integer
value specifying the time that Branch allows a click to
remain outstanding and be eligible to be matched with a new app session.String
containing the resulting short URL.public java.lang.String getShortUrlSync(java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting short URL.public java.lang.String getShortUrlSync(java.lang.String alias, java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
alias
- Link 'alias' can be used to label the endpoint on the link.
For example: http://bnc.lt/AUSTIN28. Should not exceed 128 characters
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting short URL.public java.lang.String getShortUrlSync(int type, java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
type
- An int
that can be used for scenarios where you want the link to
only deep link the first time.tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.String
containing the resulting short URL.public java.lang.String getShortUrlSync(java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, int duration)
Configures and requests a short URL to be generated by the Branch servers, via a synchronous call; with a duration specified within which an app session should be matched to the link.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.duration
- A Integer
value specifying the time that Branch allows a click to
remain outstanding and be eligible to be matched with a new app session.String
containing the resulting short URL.public void getShortUrl(Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.public void getShortUrl(JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getReferralUrl(java.lang.String channel, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a referral URL to be generated by the Branch servers.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getReferralUrl(java.util.Collection<java.lang.String> tags, java.lang.String channel, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a referral URL to be generated by the Branch servers.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putTags(Collection)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getContentUrl(java.lang.String channel, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a content URL to be generated by the Branch servers.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getContentUrl(java.util.Collection<java.lang.String> tags, java.lang.String channel, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a content URL to be generated by the Branch servers.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putTags(Collection)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(java.lang.String alias, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
alias
- Link 'alias' can be used to label the endpoint on the link.
For example: http://bnc.lt/AUSTIN28. Should not exceed 128 characters
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow process.
Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with the
link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putAlias(String)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(int type, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
type
- An int
that can be used for scenarios where you want the link to
only deep link the first time.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow process.
Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with the
link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putType(int)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, int duration, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.duration
- An int
the time that Branch allows a click to remain outstanding and
be eligible to be matched with a new app session.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putTags(Collection)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putTags(Collection)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(java.lang.String alias, java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
alias
- Link 'alias' can be used to label the endpoint on the link.
Should not exceed 128 characters.
For example: http://bnc.lt/AUSTIN28.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putAlias(String)
,
BranchLinkData.putTags(Collection)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(int type, java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
type
- An int
that can be used for scenarios where you want the link to
only deep link the first time.tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putType(int)
,
BranchLinkData.putTags(Collection)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
Branch.BranchLinkCreateListener
public void getShortUrl(java.util.Collection<java.lang.String> tags, java.lang.String channel, java.lang.String feature, java.lang.String stage, JSONObject params, int duration, Branch.BranchLinkCreateListener callback)
Configures and requests a short URL to be generated by the Branch servers.
tags
- An iterable Collection
of String
tags associated with a deep
link.channel
- A String
denoting the channel that the link belongs to. Should not
exceed 128 characters.feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.params
- A JSONObject
value containing the deep linked params associated with
the link that the user is to follow.duration
- An int
the time that Branch allows a click to remain outstanding
and be eligible to be matched with a new app session.callback
- A Branch.BranchLinkCreateListener
callback instance that will trigger
actions defined therein upon receipt of a response to a create link request.BranchLinkData
,
BranchLinkData.putTags(Collection)
,
BranchLinkData.putChannel(String)
,
BranchLinkData.putFeature(String)
,
BranchLinkData.putStage(String)
,
BranchLinkData.putParams(String)
,
BranchLinkData.putDuration(int)
,
Branch.BranchLinkCreateListener
public void getReferralCode(Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
callback
- A Branch.BranchReferralInitListener
callback instance that will trigger
actions defined therein upon receipt of a response to a referral code request.public void getReferralCode(int amount, Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
amount
- An Integer
value of credits associated with this referral code.callback
- A Branch.BranchReferralInitListener
callback instance that will trigger
actions defined therein upon receipt of a response to a referral code request.public void getReferralCode(java.lang.String prefix, int amount, Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
prefix
- A String
containing the developer-specified prefix code to be applied
to the start of a referral code. e.g. for code OFFER4867, the prefix would
be "OFFER".amount
- An Integer
value of credits associated with this referral code.callback
- A Branch.BranchReferralInitListener
callback instance that will trigger
actions defined therein upon receipt of a response to a referral code request.public void getReferralCode(int amount, java.util.Date expiration, Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
amount
- An Integer
value of credits associated with this referral code.expiration
- Optional expiration Date
of the offer code.callback
- A Branch.BranchReferralInitListener
callback instance that will trigger
actions defined therein upon receipt of a response to a referral code
request.public void getReferralCode(java.lang.String prefix, int amount, java.util.Date expiration, Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
prefix
- A String
containing the developer-specified prefix code to be
applied to the start of a referral code. e.g. for code OFFER4867, the
prefix would be "OFFER".amount
- An Integer
value of credits associated with this referral code.expiration
- Optional expiration Date
of the offer code.callback
- A Branch.BranchReferralInitListener
callback instance that will trigger
actions defined therein upon receipt of a response to a referral code
request.public void getReferralCode(java.lang.String prefix, int amount, int calculationType, int location, Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
prefix
- A String
containing the developer-specified prefix code to be
applied to the start of a referral code. e.g. for code OFFER4867, the
prefix would be "OFFER".amount
- An Integer
value of credits associated with this referral code.calculationType
- The type of referral calculation. i.e.
LINK_TYPE_UNLIMITED_USE
or
LINK_TYPE_ONE_TIME_USE
location
- The user to reward for applying the referral code.
Valid options:
callback
- A Branch.BranchReferralInitListener
callback instance that will
trigger actions defined therein upon receipt of a response to a
referral code request.public void getReferralCode(java.lang.String prefix, int amount, java.util.Date expiration, java.lang.String bucket, int calculationType, int location, Branch.BranchReferralInitListener callback)
Configures and requests a referral code to be generated by the Branch servers.
prefix
- A String
containing the developer-specified prefix code to
be applied to the start of a referral code. e.g. for code OFFER4867,
the prefix would be "OFFER".amount
- An Integer
value of credits associated with this referral code.expiration
- Optional expiration Date
of the offer code.bucket
- A String
value containing the name of the referral bucket
that the code will belong to.calculationType
- The type of referral calculation. i.e.
LINK_TYPE_UNLIMITED_USE
or
LINK_TYPE_ONE_TIME_USE
location
- The user to reward for applying the referral code.
Valid options:
callback
- A Branch.BranchReferralInitListener
callback instance that will
trigger actions defined therein upon receipt of a response to a
referral code request.public void validateReferralCode(java.lang.String code, Branch.BranchReferralInitListener callback)
Validates the supplied referral code on initialisation without applying it to the current session.
code
- A String
object containing the referral code supplied.callback
- A Branch.BranchReferralInitListener
callback to handle the server response
of the referral submission request.public void applyReferralCode(java.lang.String code, Branch.BranchReferralInitListener callback)
Applies a supplied referral code to the current user session upon initialisation.
code
- A String
object containing the referral code supplied.callback
- A Branch.BranchReferralInitListener
callback to handle the server
response of the referral submission request.Branch.BranchReferralInitListener


I am an Electrical Telecommunications Engineering who
enjoys connecting the dots: be it ideas from
different
disciplines, people from different teams, or applications from
various industries. I have strong technical
skills and an academic
background in engineering, statistics, web development, and Object-Oriented Programming.
My passion lies in solving business problems and
communicating complex ideas to non-technical stakeholders.
I can jump across verticals to deliver high-level technically written
solutions.
In my graduate studies, I've taken on various leadership roles, including mentoring
three undergraduate interns,
coordinating institute-wide events for hundreds of people, and leading clubs.
I'm graduating in November 2021, and I'm interested in part-time Electrical or Telecommunications roles.
Please feel free to get in touch with me via email at<EMAIL_ADDRESS>or use the
contact button at the end of this page.
Proficient: Networking(WAN, LAN, Routing and Switching, IP, e.t.c) Excel. Electrical Design, Electrical Installations,
Microsoft, Windows, e.t.c
Knowledgeable: SQL, JavaScript (JQuery, JSON, DOM)
Familiar: HTML, CSS.
I specialize in developing complicated but impressive web applications
, designing front-end solutions,
and creating responsive websites.
I have read almost 1200 books in different field. Among the notable ones include:
A diet guide to feeding the animals found in Manhattan Zoo with the right schedule
and amount of
food in pounds that each animal needs to be fed.
The project is written in a pseudocode language that gives logical description
to how the animals are scheduled to eat
An app project that is still in development stages with the idea
existing on github.
My personal website that contains an online CV and major events in my life. It is majorly written in HTML 5
with an incomplete css file that is yet to be completed.
My Cv website is the most fascinating thing
that I am about to create.
At the moment, I have set out to rediscover what I love in this life. But had someone asked me the question
about my hobbies a year ago, I wouldn't hestitate to let them know how much I loved swimming, hiking, working out,
travelling (majorly around Kenya), and reading amazing books.


Every brand has a unique story, I want to share yours with the world.
Every brand has a unique story, I want to share yours with the world.
Hi there! I'm Nicole. A publicist, a blogger, a brand strategist - I truly believe in the power of words. The right words. The difference between being heard and being remembered. Want to share your story? Let's talk!


It estimates the parameters of a partially linear regression censored model via maximum penalized likelihood through of ECME algorithm. The model belong to the semiparametric class, that including a parametric and nonparametric component. The error term considered belongs to the scale-mixture of normal (SMN) distribution, that includes well-known heavy tails distributions as the Student-t distribution, among others. To examine the performance of the fitted model, case-deletion and local influence techniques are provided to show its robust aspect against outlying and influential observations. This work is based in Ferreira, C. S., & Paula, G. A. (2017) <doi:10.1080/02664763.2016.1267124> but considering the SMN family.
| Version: | 1.39 |
| Imports: | ssym, optimx, Matrix |
| Suggests: | SMNCensReg, AER |
| Published: | 2018-03-08 |
| Author: | Marcela Nunez Lemus, Christian E. Galarza, Larissa Avila Matos, Victor H Lachos |
| Maintainer: | Marcela Nunez Lemus <marcela.nunez.lemus at gmail.com> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | no |
| CRAN checks: | PartCensReg results |
| Reference manual: | PartCensReg.pdf |
| Package source: | PartCensReg_1.39.tar.gz |
| Windows binaries: | r-devel: PartCensReg_1.39.zip, r-release: PartCensReg_1.39.zip, r-oldrel: PartCensReg_1.39.zip |
| OS X binaries: | r-release: PartCensReg_1.39.tgz, r-oldrel: PartCensReg_1.39.tgz |
| Old sources: | PartCensReg archive |
Please use the canonical form https://CRAN.R-project.org/package=PartCensReg to link to this page.


recv, recvfrom, recvmsg - receive a message from a socket
#include <sys/types.h>
#include <sys/socket.h>
ssize_t recv(int sockfd, void *buf, size_t len, int flags);
ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags,
struct sockaddr *src_addr, socklen_t *addrlen);
ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
The recv(), recvfrom(), and recvmsg() calls are used to
receive messages from a socket. They may be used to receive data on both
connectionless and connection-oriented sockets. This page first describes
common features of all three system calls, and then describes the differences
between the calls.
The only difference between recv() and read(2) is
the presence of flags. With a zero flags argument,
recv() is generally equivalent to read(2) (but see NOTES).
Also, the following call
recv(sockfd, buf, len, flags);
is equivalent to
recvfrom(sockfd, buf, len, flags, NULL, NULL);
All three calls return the length of the message on successful
completion. If a message is too long to fit in the supplied buffer, excess
bytes may be discarded depending on the type of socket the message is
received from.
If no messages are available at the socket, the receive calls wait
for a message to arrive, unless the socket is nonblocking (see
fcntl(2)), in which case the value -1 is returned and the external
variable errno is set to EAGAIN or EWOULDBLOCK. The
receive calls normally return any data available, up to the requested
amount, rather than waiting for receipt of the full amount requested.
An application can use select(2), poll(2), or
epoll(7) to determine when more data arrives on a socket.
The flags argument is formed by ORing one or more of the following
values:
- MSG_CMSG_CLOEXEC (recvmsg() only; since Linux 2.6.23)
- Set the close-on-exec flag for the file descriptor received via a UNIX
domain file descriptor using the SCM_RIGHTS operation (described in
unix(7)). This flag is useful for the same reasons as the
O_CLOEXEC flag of open(2).
- MSG_DONTWAIT (since Linux 2.2)
- Enables nonblocking operation; if the operation would block, the call
fails with the error EAGAIN or EWOULDBLOCK. This provides
similar behavior to setting the O_NONBLOCK flag (via the
fcntl(2) F_SETFL operation), but differs in that
MSG_DONTWAIT is a per-call option, whereas O_NONBLOCK is a
setting on the open file description (see open(2)), which will
affect all threads in the calling process and as well as other processes
that hold file descriptors referring to the same open file
description.
- MSG_ERRQUEUE (since Linux 2.2)
- This flag specifies that queued errors should be received from the socket
error queue. The error is passed in an ancillary message with a type
dependent on the protocol (for IPv4 IP_RECVERR). The user should
supply a buffer of sufficient size. See cmsg(3) and ip(7)
for more information. The payload of the original packet that caused the
error is passed as normal data via msg_iovec. The original
destination address of the datagram that caused the error is supplied via
msg_name.
- The error is supplied in a sock_extended_err structure:
-
#define SO_EE_ORIGIN_NONE 0
#define SO_EE_ORIGIN_LOCAL 1
#define SO_EE_ORIGIN_ICMP 2
#define SO_EE_ORIGIN_ICMP6 3
struct sock_extended_err
{
uint32_t ee_errno; /* Error number */
uint8_t ee_origin; /* Where the error originated */
uint8_t ee_type; /* Type */
uint8_t ee_code; /* Code */
uint8_t ee_pad; /* Padding */
uint32_t ee_info; /* Additional information */
uint32_t ee_data; /* Other data */
/* More data may follow */
};
struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
- ee_errno contains the errno number of the queued error.
ee_origin is the origin code of where the error originated. The
other fields are protocol-specific. The macro SOCK_EE_OFFENDER
returns a pointer to the address of the network object where the error
originated from given a pointer to the ancillary message. If this address
is not known, the sa_family member of the sockaddr contains
AF_UNSPEC and the other fields of the sockaddr are
undefined. The payload of the packet that caused the error is passed as
normal data.
- For local errors, no address is passed (this can be checked with the
cmsg_len member of the cmsghdr). For error receives, the
MSG_ERRQUEUE flag is set in the msghdr. After an error has
been passed, the pending socket error is regenerated based on the next
queued error and will be passed on the next socket operation.
- MSG_OOB
- This flag requests receipt of out-of-band data that would not be received
in the normal data stream. Some protocols place expedited data at the head
of the normal data queue, and thus this flag cannot be used with such
protocols.
- MSG_PEEK
- This flag causes the receive operation to return data from the beginning
of the receive queue without removing that data from the queue. Thus, a
subsequent receive call will return the same data.
- MSG_TRUNC (since Linux 2.2)
- For raw (AF_PACKET), Internet datagram (since Linux 2.4.27/2.6.8),
netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets:
return the real length of the packet or datagram, even when it was longer
than the passed buffer.
- For use with Internet stream sockets, see tcp(7).
- MSG_WAITALL (since Linux 2.2)
- This flag requests that the operation block until the full request is
satisfied. However, the call may still return less data than requested if
a signal is caught, an error or disconnect occurs, or the next data to be
received is of a different type than that returned. This flag has no
effect for datagram sockets.
recvfrom() places the received message into the buffer buf. The
caller must specify the size of the buffer in len.
If src_addr is not NULL, and the underlying protocol
provides the source address of the message, that source address is placed in
the buffer pointed to by src_addr. In this case, addrlen is a
value-result argument. Before the call, it should be initialized to the size
of the buffer associated with src_addr. Upon return, addrlen
is updated to contain the actual size of the source address. The returned
address is truncated if the buffer provided is too small; in this case,
addrlen will return a value greater than was supplied to the
call.
If the caller is not interested in the source address,
src_addr and addrlen should be specified as NULL.
The recv() call is normally used only on a connected socket (see
connect(2)). It is equivalent to the call:
recvfrom(fd, buf, len, flags, NULL, 0);
The recvmsg() call uses a msghdr structure to minimize the number
of directly supplied arguments. This structure is defined as follows in
<sys/socket.h>:
struct iovec { /* Scatter/gather array items */
void *iov_base; /* Starting address */
size_t iov_len; /* Number of bytes to transfer */
};
struct msghdr {
void *msg_name; /* Optional address */
socklen_t msg_namelen; /* Size of address */
struct iovec *msg_iov; /* Scatter/gather array */
size_t msg_iovlen; /* # elements in msg_iov */
void *msg_control; /* Ancillary data, see below */
size_t msg_controllen; /* Ancillary data buffer len */
int msg_flags; /* Flags on received message */
};
The msg_name field points to a caller-allocated buffer that
is used to return the source address if the socket is unconnected. The
caller should set msg_namelen to the size of this buffer before this
call; upon return from a successful call, msg_namelen will contain
the length of the returned address. If the application does not need to know
the source address, msg_name can be specified as NULL.
The fields msg_iov and msg_iovlen describe
scatter-gather locations, as discussed in readv(2).
The field msg_control, which has length
msg_controllen, points to a buffer for other protocol control-related
messages or miscellaneous ancillary data. When recvmsg() is called,
msg_controllen should contain the length of the available buffer in
msg_control; upon return from a successful call it will contain the
length of the control message sequence.
The messages are of the form:
struct cmsghdr {
size_t cmsg_len; /* Data byte count, including header
(type is socklen_t in POSIX) */
int cmsg_level; /* Originating protocol */
int cmsg_type; /* Protocol-specific type */
/* followed by
unsigned char cmsg_data[]; */
};
Ancillary data should be accessed only by the macros defined in
cmsg(3).
As an example, Linux uses this ancillary data mechanism to pass
extended errors, IP options, or file descriptors over UNIX domain
sockets.
The msg_flags field in the msghdr is set on return
of recvmsg(). It can contain several flags:
- MSG_EOR
- indicates end-of-record; the data returned completed a record (generally
used with sockets of type SOCK_SEQPACKET).
- MSG_TRUNC
- indicates that the trailing portion of a datagram was discarded because
the datagram was larger than the buffer supplied.
- MSG_CTRUNC
- indicates that some control data was discarded due to lack of space in the
buffer for ancillary data.
- MSG_OOB
- is returned to indicate that expedited or out-of-band data was
received.
- MSG_ERRQUEUE
- indicates that no data was received but an extended error from the socket
error queue.
These calls return the number of bytes received, or -1 if an error occurred. In
the event of an error, errno is set to indicate the error.
When a stream socket peer has performed an orderly shutdown, the
return value will be 0 (the traditional "end-of-file" return).
Datagram sockets in various domains (e.g., the UNIX and Internet
domains) permit zero-length datagrams. When such a datagram is received, the
return value is 0.
The value 0 may also be returned if the requested number of bytes
to receive from a stream socket was 0.
These are some standard errors generated by the socket layer. Additional errors
may be generated and returned from the underlying protocol modules; see their
manual pages.
- EAGAIN or EWOULDBLOCK
- The socket is marked nonblocking and the receive operation would block, or
a receive timeout had been set and the timeout expired before data was
received. POSIX.1 allows either error to be returned for this case, and
does not require these constants to have the same value, so a portable
application should check for both possibilities.
- EBADF
- The argument sockfd is an invalid file descriptor.
- ECONNREFUSED
- A remote host refused to allow the network connection (typically because
it is not running the requested service).
- EFAULT
- The receive buffer pointer(s) point outside the process's address
space.
- EINTR
- The receive was interrupted by delivery of a signal before any data was
available; see signal(7).
- EINVAL
- Invalid argument passed.
- ENOMEM
- Could not allocate memory for recvmsg().
- ENOTCONN
- The socket is associated with a connection-oriented protocol and has not
been connected (see connect(2) and accept(2)).
- ENOTSOCK
- The file descriptor sockfd does not refer to a socket.
POSIX.1-2001, POSIX.1-2008, 4.4BSD (these interfaces first appeared in 4.2BSD).
POSIX.1 describes only the MSG_OOB, MSG_PEEK, and
MSG_WAITALL flags.
If a zero-length datagram is pending, read(2) and recv() with a
flags argument of zero provide different behavior. In this
circumstance, read(2) has no effect (the datagram remains pending),
while recv() consumes the pending datagram.
The socklen_t type was invented by POSIX. See also
accept(2).
According to POSIX.1, the msg_controllen field of the
msghdr structure should be typed as socklen_t, but glibc
currently types it as size_t.
See recvmmsg(2) for information about a Linux-specific
system call that can be used to receive multiple datagrams in a single
call.
An example of the use of recvfrom() is shown in getaddrinfo(3).
fcntl(2), getsockopt(2), read(2), recvmmsg(2),
select(2), shutdown(2), socket(2), cmsg(3),
sockatmark(3), ip(7), ipv6(7), socket(7),
tcp(7), udp(7), unix(7)
This page is part of release 5.05 of the Linux man-pages project. A
description of the project, information about reporting bugs, and the latest
version of this page, can be found at https://www.kernel.org/doc/man-pages/.


Radicle Stack
Radicle utilities are written in the Radicle language, a deterministic
Lisp dialect built for creating P2P programs. Each instance of a
utility is a replicated state machine with state updates distributed
and replicated via IPFS.
The Radicle daemon materializes machines from the local event log,
allowing you to query a machine's state, and handles the submission of
new expressions.
We have also created an IPFS git remote helper for hosting your code on
IPFS. Together with utilities such as rad project
rad
issues
, and rad patches
, you can now have an
entirely decentralized code collaboration experience.


Main Concepts
Dependency Injection - DI Exceptions
-
typescript will not generate these metadata for standard classes
(typescript is not Angular, and DI is based on Angular)
-
While working with components, the @Component annotation
let typescript know that it has to generate these metadata
so services are injected autommatically
-
But services which depend on other services doesn't use any annotation
by default
-
By default angular CLI add @Injectable on every service class generated:
@Injectable
class MyService{
constructor(dep: MyDepService){
//...
}
}
-
Otherwise you can add @Inject on the constructor parameters:
constructor(@Inject(MyService) myService: MyService){}
Detailed article here


---
layout: project
title: iGPS based Motion Control of Robotic Manipulator Using Robot Operating System (ROS)
shorttitle: iGPS based Motion Control of Robotic Manipulator using ROS
location: RWTH Aachen, Germany
type: robotics
image: ur5.jpg
category: projects
published: true
year: 2016
duration: October 2016 - March 2017
position: Master's thesis at Institut für Getriebetechnik und Maschinendynamik (IGM)
advisor: Univ.-Prof. Burkhard Corves, Dr. Sourav Rakshit
---
{% include JB/setup %}
Devised algorithms for accurate control of robotic manipulator using indoor GPS (iGPS) feedback
Developed ROS packages for iGPS based motion control of Universal Robot-5 manipulator
Evaluated accuracy of iGPS based motion control algorithms using Gazebo model and actual UR-5 robot


There’s little doubt from the budget offered last month that Donald Trump wants to take the government in some radically different directions than that of his predecessor in the Oval Office, Barack Obama. Trump’s initial blueprint for fiscal year 2018 calls for massive increases in military spending and immigration enforcement, along with hefty reductions in foreign aid, environmental protection and a grab bag of social programs.
But beyond the headlines, deep in the agate type of their respective budget proposals, are areas in which the two Presidents of wildly differing ideologies actually agree — to a point. A Center of Public Integrity review found some TK programs that both chief executives targeted for trims in the last two budget go-rounds, albeit often to different degrees. More such programs may emerge when Trump presents a more detailed budget plan in May.
No doubt some would argue that the programs highlighted here must have problems if both Trump and Obama are calling for cuts. But these line items also demonstrate how difficult it is to cut anything in Washington, as every initiative has some constituency of its own, a constituency certain to howl at the prospect of less money, never mind outright elimination. For some programs the mere fact they still exist is evidence of that, as Trump would hardly be calling for elimination now if Obama had succeeded last year in zeroing them out.
Behind these numbers is also evidence that crafting a budget at all has become a herculean task in the nation’s capital. Our comparisons below start with Obama’s proposals for fiscal year 2017, but virtually none of these were ever enacted because almost no appropriations bills were completed. Instead, a series of continuing resolutions has essentially frozen most 2016 budget levels in place.
But even as an academic exercise, it’s illuminating to see which programs neither Trump nor Obama was apparently an unabashed fan of. So here they are:


A simple, powerful & extensible platform for stakeholders of an educational enterprise.
Nursery to college under one umbrella. Customizations on request!
Provides an ecosystem for teachers, students, parents & management under one unified platform
SMS
Web presence
Social Media (FB / Twitter / Blog)
Cloud based solutions
On premise servers (Mail / File)
Custom applications (Web / Mobi / Desktop)
Integration platform with real-time analytics
Networking
Firewall / Spam filters
Backup & encryption services
IT audit & management services
If we were to describe our journey so far in one word then it is "Happy Customers". Two words really but for us it is two words fused into one that defines the purpose of this company.
By closely working with users , we made UX improvements , enhanced existing features , added new ones and scaled our cloud infrastructure , the whole shebang !
Adopted successfully in institutions , has been highly effective in reducing the hours spent by staff (Teaching and Non-Teaching) towards report generation and communication with parents.
Built a cloud platform to run the company. We run everything on cloud ... really! Established healthy working relationship with technology partners & vendors. Along with them we can provide any end-to-end solution, today. Most importantly we worked closely with customers to provide solutions that they are using everyday.
with a laser sharp focus to ...
Provide end-to-end, complete solution
Within a reasonable cost & timeline
Backed by excellent support
A bunch of geeks & entrepreneurs sat around a coffee table & brain-stormed. They realized, anybody in need of a non-trivial technology solution would need a fusion of varied technologies that need to be orchestrated. And people are interested in getting the work done now! and not really spend time & effort in orchestrating technology.
We're building a company based on Transparency, Skills & Trust. We promise transparency in all our dealings. Provide relevant solutions that are based on bleeding edge technology. And we've got your back covered. Do what you do best & leave the technology to us.
Here are some of our happy customers


The function prints for each m-Tree's level (from the level 1 to maximum level), the nodes from the
left to the right (a new level is started when the nodes from the level before are finished).
The function prints for each m-Tree's level (from the level 1 to maximum level), the nodes from the
left to the right (a new level is started when the nodes from the level before are finished).
The function implements a merge of two m-Trees, using the GBX algorithm described in "Crossover and Mutation Operators for
Grammar-Guided Genetic Programming" as a guide.
The function has the same behavior that the function "crossoverGBX", and it has been added with the following
additional feature: it updates the nodes that have an Element with a symbol "s" (those nodes have associated a
function f and a value v).