Android Full Reference

Maven CentralMaven Central JavadocsJavadocs


The compiled Android SDK footprint is 187kb

Install Library Project

Just add implementation '' to the dependencies section of your build.gradle file.

Some notes:

  • If you don't plan to use the Fabric Answers integration, and don't want to import the answers-shim, just import your project as follows:
implementation ('') {
  exclude module: 'answers-shim'
  • This supports minimum sdk level 16. If you want to support minimum sdk level 9 please consider using version 1.14.5. If you want to to support a minimum SDK of 15, use the 2.x versions.
  • Android SDK versions 3.x and above communicate over TLS1.2.
  • If you want to import the AAR directly, you can find the build in Nexus here:
  • Or you can clone this repo and import the source as a library into your project

Register Your App

You can sign up for your own app id at

Register an activity for direct deep linking (optional but recommended)

In your project's manifest file, you can register your app to respond to direct deep links (yourapp:// in a mobile browser) by adding the second intent filter block. Also, make sure to change yourapp to a unique string that represents your app name.

Secondly, make sure that this activity is launched as a singleTask. This is important to handle proper deep linking from other apps like Facebook.

Typically, you would register some sort of splash activitiy that handles routing for your app.

    <!-- Make sure the activity is launched as "singleTask" -->
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />

    <!-- Add this intent filter below, and change yourapp to your app name -->
        <data android:scheme="yourapp" android:host="open" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

Leverage Android App Links for deep linking

If you are building applications targeting for Android M or above, Branch make it really easy to configure your app for deep linking using App Links. In your project's manifest file, you can register activities to for App Linking by adding an intent filter as follows.

If using

With, there's no need to use the encoded id and you just need to list the domains.

<activity android:name="com.yourapp.your_activity">
    <!-- App Link your activity to Branch links-->
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
         <data android:scheme="https" android:host="" />
         <data android:scheme="https" android:host="" />

If using or a custom domain

You only need to know live_app_alpha_encoded_id and test_app_alpha_encoded_id which you can obtain from the Branch dash board once you enable App Linking support for your application.

<activity android:name="com.yourapp.your_activity">
    <!-- App Link your activity to Branch links-->
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
         <data android:scheme="https" android:host="" android:pathPrefix="/live_app_alpha_encoded_id" /> <!-- live_app_alpha_encoded_id can be obtained from the Branch Dashboard here: -->
         <data android:scheme="https" android:host="" android:pathPrefix="/test_app_alpha_encoded_id" /> <!-- test_app_alpha_encoded_id can be obtained from the Branch Dashboard here: -->
        <!-- If you set up a white label for your links in your Branch link settings then  only need to add the white label domain -->
        <data android:scheme="https" android:host=""/>

That's all you need. Deep linked parameters associated with the link is passed through Branch initialization process.

Note: While using App Links please make sure you have registered the Activity for deep linking using Branch URI scheme as discussed in the previous session inorder to get deep link work on previous versions of Android
(which does not support App Links).

Deeplink via push notification

You can deep link to content from push notifications just by adding a Branch link to your result intent. Simply pass the a Branch link with gcm payload and add it to your resultIntent with key branch.

Intent resultIntent = new Intent(this, TargetClass.class);
       PendingIntent resultPendingIntent =  PendingIntent.getActivity(this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);

If you would like to support push notification based routing while your app already in foreground, please add the following to your notification intent.


Guaranteed Matching

Branch support hundred percent guaranteed matching with cookie based matching using Custom Chrome Tabs. This is highly recommended if you like to do user authentication through deep link metadata.
Just add the following to your build.gradle file to enable guaranteed matching

implementation ''

Note : Adding additional dependencies may overrun the dex limit and lead to NoClassDefFoundError or ClassNotFoundException. Please make sure you have enabled multi-dex support to solve this issue. For more information on enabling multi-dex support please refer to Troubleshooting

Configure your AndroidManifest.xml

Note: Provide internet permission. Branch SDK need internet access to talk to Branch APIs.

Add your Branch key to your project.

After you register your app, your Branch key can be retrieved on the Settings page of the dashboard. Add it (them, if you want to do it for both your live and test apps) to your project's manifest file as a meta data.

Edit your manifest file to have the above items

<manifest xmlns:android=""
    android:versionName="1.0" >

    <uses-permission android:name="android.permission.INTERNET" />

        <!-- Other existing entries -->

        <!-- Add this meta-data below, and change "key_live_xxxxxxx" to your actual live Branch key -->
        <meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_xxxxxxx" />

        <!-- For your test app, if you have one; Again, use your actual test Branch key -->
        <meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_yyyyyyy" />

Proguard settings for leveraging Branch's pooled matching

To collect the Google Advertising ID, you must ensure that proguard doesn't remove the necessary Google Ads class. The surest way to do this is add it to your proguard rules. If your Application is enabled with proguard, add the following instruction to your proguard.cfg or file:

-keep class** { *; }
In case you are using Facebook SDK to support deep linking through Facebook ads, please make sure to keep the Facebook SDK classes in proguard
-keep class com.facebook.applinks.** { *; }
-keepclassmembers class com.facebook.applinks.** { *; }
-keep class com.facebook.FacebookSdk { *; }

If you are adding support for Huawei devices without Google Mobile Services, please make sure to add this to your proguard rules.

-keep class** { *; }
-keep interface** { *; }

Instant App Deep Linking and Attribution Support

The Branch SDK make it easier to deep link and attribute your Instant Apps. Since Branch automatically configures and hosts the assetlinks.json file for you, you don't need to worry about all the complexity involved in setting up Android App Links. Additionally, the Branch SDK makes it easy to deferred deep link from the Instant App through the full Android app install, providing attribution for every step of the way. Please make sure you have the following added along with regular Branch implementation for instant app enabled project

You can check out a full demo application on our Github. We've replicated our original Android demo application and modified it to support Android Instant Apps.

1. Initialize the Branch SDK

Head to your core library project, where your Application class is defined and drop in the snippet of code to the onCreate() method as follows.

public void onCreate() {

  // Initialize the Branch SDK

2. Add your Branch keys

Instant Apps can be rather confusing as there are many different manifests, but you want to find the Manifest that contains your application tags. Make sure your Application class name is defined here, and then specify the Branch keys inside the application element.


  <meta-data android:name="io.branch.sdk.TestMode" android:value="false" /> <!-- Set to true to use Branch_Test_Key -->
  <meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_my_live_key" />
  <meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_my_test_key" />

3. Configure your Branch links as Android App Links

This guide presumes that you've already configured Branch for Android App Links in the past. If you haven't configured your full native app to use Branch as Android App Links, please complete this guide which will correctly configure the dashboard and manifest.

Now, you simply need to edit the above manifest and paste in the following snippet inside the application element. Then you'll need to replace the xxxx with your own custom subdomain which will be visible on the Branch link settings dashboard at the bottom of the page. If you're using a custom subdomain, you can find the advanced instructions in the above link regarding configuring Android App Links.


  <intent-filter android:autoVerify="true">
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.DEFAULT" />
      <category android:name="android.intent.category.BROWSABLE" />
      <data android:scheme="https" android:host="" />
      <data android:scheme="https" android:host="" />


4. Retrieve Branch deep link data

Now that you've outfitted your Instant App project with the above, you can now register a deep link router function for activities you want to receive the deep link data in any Activity split, similar to how you would retrieve deep link data in the full app.

5. Configure the deep linking from Instant App to your Full App

Now, the user has arrived in your Instant App and you're ready to convert them to install your full native app. Don't worry, Branch as got your covered! We have overridden the default showInstallPrompt with a method that auto configures the Google Play prompt with all of the deep link data you need to carry context through install. Additionally, we can provide you the full set of attribution on how many users conver through this prompt.

Branch SDK provides convenient methods to check for app types and full app conversion. This eliminates the dependency on Google IA support SDK (''). Here are some of the methods that makes life easy

  • Branch#isInstantApp()

This convenience methods checks whether the current version of app running is Instant App or Full Android App to allow you convenience

  • Branch#showInstallPrompt()

This methods shows an install prompt for the full Android app, allowing you an easy way to pass Branch referring deep data to the full app through the install process. Similar to how deferred deep linking works for Branch normally, the full app will receive the deep link params in the handle callback.

The below example shows how to create a custom Branch Universal Object, the associate it with the installation prompt that will be passed through to your full native Android app after the user installs.

if (Branch.isInstantApp(this)) {
  myFullAppInstallButton.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {
       BranchUniversalObject branchUniversalObject = new BranchUniversalObject()
           .setTitle("My Content Title")
           .setContentDescription("My Content Description")
           .setContentMetadata(new ContentMetadata()
                 .addCustomMetadata("property1", "blue")
                 .addCustomMetadata("property2", "red"));

      Branch.showInstallPrompt(myActivity, activity_ret_code, branchUniversalObject);
} else {


If your minimum sdk level is 15+, To receive the deep link parameters from the Branch SDK, call initSession and pass in the BranchReferralInitListener. This will return the dictionary of referringParams associated with the link that was just clicked. You can call this anywhere at any time to get the params.

If you need to support pre 15, Branch must know when the app opens or closes to properly handle the deep link parameters retrieval. You can see more details on how to do this at [this docs site](/developers-hub/docs/android-sdk-overview. Basically, if you don't close the Branch session, you'll see strange behaviors like deep link parameters not showing up after clicking a link the second time.

Initialize Branch lifecycle

Initialising and closing session is done automatically with our new automatic session management.

Alt 1: You Have A Custom Application Class

If you have a custom Application class, just add this call in onCreate

public void onCreate() {

Alt 2: You Don't Have A Custom Application Class

If you are not creating or using an Application class throughout your project, all you need to do is declare BranchApp as your application class in your manifest.


Register deep link router

Branch branch = Branch.getInstance(getApplicationContext());
branch.initSession(new BranchReferralInitListener(){
    public void onInitFinished(JSONObject referringParams, BranchError error) {
        if (error == null) {
            // params are the deep linked params associated with the link that the user clicked -> was re-directed to this app
            // params will be empty if no data found
            // ... insert custom logic here ...
        } else {
            Log.i("MyApp", error.getMessage());
}, this.getIntent().getData(), this);

NOTE if you're calling this inside a fragment, please use getActivity() instead of passing in this. Also, this.getIntent().getData() refers to the data associated with an incoming intent.

Next, you'll need to hook into the onNewIntent method specified inside the Activity lifecycle and set the intent. This is required for conformity with Facebook's AppLinks. Verify that the activity you're implementing has launchMode set to singleTask inside the Manifest declaration. Once that is done, go to said activity and do something like the following:

public void onNewIntent(Intent intent) {

Branch-provided data parameters in initSession callback

Previously, Branch did not return any information to the app if initSession was called but the user hadn't clicked on a link. Now Branch returns explicit parameters every time. Here is a list, and a description of what each represents.

  • ~ denotes analytics
  • + denotes information added by Branch
  • (for the curious, $ denotes reserved keywords used for controlling how the Branch service behaves)
~channelThe channel on which the link was shared, specified at link creation time
~featureThe feature, such as invite or share, specified at link creation time
~tagsAny tags, specified at link creation time
~campaignThe campaign the link is associated with, specified at link creation time
~stageThe stage, specified at link creation time
~creation_sourceWhere the link was created ('API', 'Dashboard', 'SDK', 'iOS SDK', 'Android SDK', or 'Web SDK')
+match_guaranteedTrue or false as to whether the match was made with 100% accuracy
+referrerThe referrer for the link click, if a link was clicked
+phone_numberThe phone number of the user, if the user texted himself/herself the app
+is_first_sessionDenotes whether this is the first session (install) or any other session (open)
+clicked_branch_linkDenotes whether or not the user clicked a Branch link that triggered this session
+click_timestampEpoch timestamp of when the click occurred

Retrieve session (install or open) parameters

These session parameters will be available at any point later on with this command. If no params, the dictionary will be empty. This refreshes with every new session (app installs AND app opens)

Branch branch = Branch.getInstance(getApplicationContext());
JSONObject sessionParams = branch.getLatestReferringParams();

To retrieve this information synchronously, call the following from a non-UI thread:

JSONObject sessionParams = branch.getLatestReferringParamsSync();

Retrieve install (install only) parameters

If you ever want to access the original session params (the parameters passed in for the first install event only), you can use this line. This is useful if you only want to reward users who newly installed the app from a referral link or something.

Branch branch = Branch.getInstance(getApplicationContext());
JSONObject installParams = branch.getFirstReferringParams();

To retrieve this information synchronously, call the following from a non-UI thread:

JSONObject sessionParams = branch.getFirstReferringParamsSync();

Persistent identities

Often, you might have your own user IDs, or want referral and event data to persist across platforms or uninstall/reinstall. It's helpful if you know your users access your service from different devices. This where we introduce the concept of an 'identity'.

To identify a user, just call:

Branch branch = Branch.getInstance(getApplicationContext());
branch.setIdentity(your user id); // your user id should not exceed 127 characters


If you provide a logout function in your app, be sure to clear the user when the logout completes. This will ensure that all the stored parameters get cleared and all events are properly attributed to the right identity.

Warning this call will clear the referral credits and attribution on the device.


Register custom events

Branch branch = Branch.getInstance(getApplicationContext());
branch.userCompletedAction("your_custom_event"); // your custom event name should not exceed 63 characters

OR if you want to store some state with the event

Branch branch = Branch.getInstance(getApplicationContext());
branch.userCompletedAction("your_custom_event", (JSONObject)appState); // same 63 characters max limit

Some example events you might want to track:


Branch Universal Object (for deep links, content analytics and indexing)

As more methods have evolved in Android, we've found that it was increasingly hard to manage them all. We abstracted as many as we could into the concept of a Branch Universal Object. This is the object that is associated with the thing you want to share (content or user). You can set all the metadata associated with the object and then call action methods on it to get a link or register a view.

Branch Universal Object best practices

Here are a set of best practices to ensure that your analytics are correct, and your content is ranking on Spotlight effectively.

  1. Set the canonicalIdentifier to a unique, de-duped value across instances of the app
  2. Ensure that the title, contentDescription and imageUrl properly represent the object
  3. Initialize the Branch Universal Object and call userCompletedAction with the BranchEvent.VIEW on page load
  4. Call showShareSheet and createShortLink later in the life cycle, when the user takes an action that needs a link
  5. Call the additional object events (purchase, share completed, etc) when the corresponding user action is taken

Practices to avoid:

  1. Don't set the same title, contentDescription and imageUrl across all objects
  2. Don't wait to initialize the object and register views until the user goes to share
  3. Don't wait to initialize the object until you conveniently need a link
  4. Don't create many objects at once and register views in a for loop.

Defining the Branch Universal Object

The universal object is where you define all of the custom metadata associated with the content that you want to link to or index. Please use the builder format below to create one.

BranchUniversalObject branchUniversalObject = new BranchUniversalObject()

            // The identifier is what Branch will use to de-dupe the content across many different Universal Objects

            // The canonical URL for SEO purposes (optional)

            // This is where you define the open graph structure and how the object will appear on Facebook or in a deepview
            .setTitle("My Content Title")
            .setContentDescription("My Content Description")

            // You use this to specify whether this content can be discovered publicly - default is public

            // Here is where you can add custom keys/values to the deep link data
            .setContentMetadata(new ContentMetadata()
                             .addCustomMetadata("property1", "blue")
                             .addCustomMetadata("property2", "red"));


canonicalIdentifier: This is the unique identifier for content that will help Branch dedupe across many instances of the same thing. If you have a website with pathing, feel free to use that. Or if you have database identifiers for entities, use those.

title: This is the name for the content and will automatically be used for the OG tags. It will insert $og_title into the data dictionary of any link created.

contentDescription: This is the description for the content and will automatically be used for the OG tags. It will insert $og_description into the data dictionary of any link created.

imageUrl: This is the image URL for the content and will automatically be used for the OG tags. It will insert $og_image_url into the data dictionary of any link created.

metadata: These are any extra parameters you'd like to associate with the Branch Universal Object. These will be made available to you after the user clicks the link and opens up the app. To add more keys/values, just use the method addMetadataKey.

price: The price of the item to be used in conjunction with the commerce related events below.

currency: The currency representing the price in ISO 4217 currency code. Default is USD.

contentIndexMode: Can be set to the ENUM of either ContentIndexModePublic or ContentIndexModePrivate. Public indicates that you'd like this content to be discovered by other apps. Currently, this is only used for Spotlight indexing but will be used by Branch in the future.

expirationDate: The date when the content will not longer be available or valid. Currently, this is only used for Spotlight indexing but will be used by Branch in the future.

Tracking User Actions and Events

Use BranchEvent class to track special user actions or application specific events beyond app installs, opens, and sharing. You can track events such as when a user adds an item to an on-line shopping cart, or searches for a keyword etc.
BranchEvent provides an interface to add content(s) represented by a BranchUniversalObject in order to associate content(s) with events.
You can view analytics for the BranchEvents you fire on the Branch dashboard. BranchEvents provide a seamless integration with many third party analytics providers like Google Analytics, Criteo.
BRANCH_STANDARD_EVENT enumerate the most commonly tracked events and event parameters that can be used with BranchEvent for the best results. You can always use custom event names and event parameters.

    .addCustomDataProperty("Custom_Event_Property_Key", "Custom_Event_Property_Val")
    .addContentItems(contentBUO1, contentBUO2)
new BranchEvent("My_Custom_Event")
    .addCustomDataProperty("key1", "value1")
    .addCustomDataProperty("key2", "value2")

Register User Actions On An Object

This functionality is deprecated. Please consider using BranchEvent for tracking user action and events as described here.

We've added a series of custom events that you'll want to start tracking for rich analytics and targeting. Here's a list below with a sample snippet that calls the register view event.

BranchEvent.VIEWUser viewed the object
BranchEvent.ADD_TO_WISH_LISTUser added the object to their wishlist
BranchEvent.ADD_TO_CARTUser added object to cart
BranchEvent.PURCHASE_STARTEDUser started to check out
BranchEvent.PURCHASEDUser purchased the item
BranchEvent.SHARE_STARTEDUser started to share the object
BranchEvent.SHARE_COMPLETEDUser completed a share

Creating a Deep Link

Once you've created your Branch Universal Object, which is the reference to the content you're interested in, you can then get a link back to it with the mechanisms described below. First define the properties of the link itself.

LinkProperties linkProperties = new LinkProperties()
               .addControlParameter("$desktop_url", "")
               .addControlParameter("$ios_url", "");

You do custom redirection by inserting the following optional keys in the control params:

"$fallback_url"Where to send the user for all platforms when app is not installed. Note that Branch will forward all robots to this URL, overriding any OG tags entered in the link.
"$desktop_url"Where to send the user on a desktop or laptop. By default it is the Branch-hosted text-me service
"$android_url"The replacement URL for the Play Store to send the user if they don't have the app. Only necessary if you want a mobile web splash
"$ios_url"The replacement URL for the App Store to send the user if they don't have the app. Only necessary if you want a mobile web splash
"$ipad_url"Same as above but for iPad Store
"$fire_url"Same as above but for Amazon Fire Store
"$blackberry_url"Same as above but for Blackberry Store
"$windows_phone_url"Same as above but for Windows Store

You have the ability to control the direct deep linking of each link by inserting the following optional keys in the control params:

"$deeplink_path"The value of the deep link path that you'd like us to append to your URI. For example, you could specify "$deeplink_path": "radio/station/456" and we'll open the app with the URI "yourapp://radio/station/456?link_click_id=branch-identifier". This is primarily for supporting legacy deep linking infrastructure.
"$always_deeplink"true or false. (default is not to deep link first) This key can be specified to have our linking service force try to open the app, even if we're not sure the user has the app installed. If the app is not installed, we fall back to the respective app store or $platform_url key. By default, we only open the app if we've seen a user initiate a session in your app from a Branch link (has been cookied and deep linked by Branch)

Then, make a request to the Universal Object in order to create the URL.

branchUniversalObject.generateShortUrl(this, linkProperties, new BranchLinkCreateListener() {
    public void onLinkCreate(String url, BranchError error) {
        if (error == null) {
            Log.i("MyApp", "got my Branch link to share: " + url);

List links in Google Search with App Indexing

Getting your Branch link and app content listed in Google search is very easy with BranchUniversalObject. Once you've created the BUO, use the following API to list your app contents in Google Search via Firebase App Indexing API. Your app will be opened with deep link data upon user clicking the search result and the session will be tracked.
This also allow your contents Indexed locally and shown in Google In Apps search. By default the the BranchUniversal objects are locally indexable. Set your BranchUniversalObject's local index mode to private if intended to avoid indexing locally


NOTE Please make sure Firebase app indexing is enabled for your application and has Firebase app indexing dependency added

'implementation ''
To test content indexing follow instructions[here](
Please enable debug mode and check the logs to get the Branch link used for indexing and use it with the above link to verify content indexing.

**NOTE** Use `BranchUniversalObject#removeFromLocalIndexing` method to remove the contents from local index. Please make sure to remove user specific contents from local index up on user logout.

## Showing a Custom Share Sheet

We’ve realized that Android had some very poor offerings for native share sheet functionality, so we built our own and bundled it into the core SDK. This share sheet it customizable and will automatically generate a link when the user selects a channel to share to.

![Android Share Sheet](

To use it, first define the custom share sheet style like so. Most of these are completely optional and we've got a great set of defaults if you don't want to spend hours customizing.
ShareSheetStyle shareSheetStyle = new ShareSheetStyle(MainActivity.this, "Check this out!", "This stuff is awesome: ")
                .setCopyUrlStyle(getResources().getDrawable(android.R.drawable.ic_menu_send), "Copy", "Added to clipboard")
                .setMoreOptionStyle(getResources().getDrawable(android.R.drawable.ic_menu_search), "Show more")
                .setSharingTitle("Share With");

To show the share sheet, call the following on your Branch Universal Object. There are plenty of callback methods for you to hook into as you need for your own customizations on top of our animation.

                                       new Branch.ExtendedBranchLinkShareListener() {
    public void onShareLinkDialogLaunched() {
    public void onShareLinkDialogDismissed() {
    public void onLinkShareResponse(String sharedLink, String sharedChannel, BranchError error) {
    public void onChannelSelected(String channelName) {
    public boolean onChannelSelected(String channelName, BranchUniversalObject buo, LinkProperties linkProperties) {
        return false;

Referral Rewards

Referral system rewarding functionality

Get reward balance

Reward balances change randomly on the backend when certain actions are taken (defined by your rules), so you'll need to make an asynchronous call to retrieve the balance. Here is the syntax:

Branch branch = Branch.getInstance(getApplicationContext());
branch.loadRewards(new BranchReferralStateChangedListener() {
    public void onStateChanged(boolean changed, Branch.BranchError error) {
        // changed boolean will indicate if the balance changed from what is currently in memory

        // will return the balance of the current user's credits
        int credits = branch.getCredits();

Redeem all or some of the reward balance (store state)

We will store how many of the rewards have been deployed so that you don't have to track it on your end. In order to save that you gave the credits to the user, you can call redeem. Redemptions will reduce the balance of outstanding credits permanently.

Branch branch = Branch.getInstance(getApplicationContext());

Get credit history

This call will retrieve the entire history of credits and redemptions from the individual user. To use this call, implement like so:

Branch branch = Branch.getInstance(getApplicationContext());
branch.getCreditHistory(new BranchListResponseListener() {
    public void onReceivingResponse(JSONArray list, Branch.BranchError error) {
        if (error == null) {
            // show the list in your app
        } else {
            Log.i("MyApp", error.getMessage());

The response will return an array that has been parsed from the following JSON:

        "transaction": {
                           "date": "2014-10-14T01:54:40.425Z",
                           "id": "50388077461373184",
                           "bucket": "default",
                           "type": 0,
                           "amount": 5
        "event" : {
            "name": "event name",
            "metadata": { your event metadata if present }
        "referrer": "12345678",
        "referree": null
        "transaction": {
                           "date": "2014-10-14T01:55:09.474Z",
                           "id": "50388199301710081",
                           "bucket": "default",
                           "type": 2,
                           "amount": -3
        "event" : {
            "name": "event name",
            "metadata": { your event metadata if present }
        "referrer": null,
        "referree": "12345678"

referrer : The id of the referring user for this credit transaction. Returns null if no referrer is involved. Note this id is the user id in developer's own system that's previously passed to Branch's identify user API call.

referree : The id of the user who was referred for this credit transaction. Returns null if no referree is involved. Note this id is the user id in developer's own system that's previously passed to Branch's identify user API call.

type : This is the type of credit transaction

  1. 0 - A reward that was added automatically by the user completing an action or referral
  2. 1 - A reward that was added manually
  3. 2 - A redemption of credits that occurred through our API or SDKs
  4. 3 - This is a very unique case where we will subtract credits automatically when we detect fraud

Enable or Disable User Tracking

In order to comply with tracking requirements, you can disable tracking at the SDK level. Simply call:


This will prevent any Branch requests from being sent across the network, except for the case of deep linking. If someone clicks a Branch link, but has expressed not to be tracked, we will return deep linking data back to the client but without tracking information captured.

In do-not-track mode, you will still be able to create and share links. They will not have identifiable information. Event tracking won’t pass data back to the server if a user has expressed to not be tracked. You can change this behavior at any time, but calling the above function. This information will be saved and persisted.

Updated 2 months ago

Android Full Reference

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.