Implementation Guide

👍

Developer Demo

Display our demo page in your app to test during development https://median.dev/branch

Configure Plugin

Enter configuration values on Native Plugins tab

Retrieve Branch.io values from the Branch Dashboard at https://dashboard.branch.io and set on the Native Plugins tab within the Median App Studio under Advanced Mode.

Live Mode Config

Obtain from https://dashboard.branch.io/account-settings/profile:

  • liveKey: Required Branch SDK key
    • Configure -> Account Settings -> Profile -> Branch Key

Obtain from https://dashboard.branch.io/configuration/general:

  • linkDomain: Domain required for App Links to work.
    • Configure -> Configurations -> General -> Link Domain
  • alternateLinkDomain: Required for Universal Links and App Links with the Journeys/Web SDK and Deepviews inside your website.
    • Configure -> Configurations -> General -> Link Domain
  • uriScheme: Optional app redirection feature. Must be set from Android URI Scheme
    • Configure -> Configurations -> General -> Android Redirects

Test Mode Config

Optional keys for testing. Enable the Test toggle on the Branch.io Dashboard to obtain and use the test config. Then set enableTestMode to true.

Obtain from https://dashboard.branch.io/account-settings/profile:

  • testKey: Required Branch SDK key
    • Configure -> Account Settings -> Profile -> Branch Key

Obtain from https://dashboard.branch.io/configuration/general:

  • testLinkDomain: Domain required for App Links to work.
    • Configure -> Configurations -> General -> Link Domain
  • testAlternateLinkDomain: Required for Universal Links and App Links with the Journeys/Web SDK and Deepviews inside your website.
    • Configure -> Configurations -> General -> Link Domain
{
  liveKey: String, // required
  testKey: String, // optional
  linkDomain: String, // optional
  alternateLinkDomain: String, // optional,
  testLinkDomain: String, // optional
  testAlternateLinkDomain: String, // optional
  uriScheme: String, // optional
  enableTestMode: Boolean // optional, default is false
}

Enable App Deep linking

Configure your Android Redirects settings on the Branch Dashboard. Ensure “I have an Android App” and “Enable App Links” are enabled and set up.

🚧

SHA256 Cert Fingerprints

It’s important to specify the SHA256 Cert Fingerprints for App links to work properly on Android M and above. See https://help.branch.io/using-branch/docs/configure-default-link-behaviors:

JavaScript Bridge methods for runtime

Initialized Callback

The app calls this callback function when Branch SDK is has finished initializing and returns data from the link that referred the current session.

↔️Median JavaScript Bridge

median_branch_initialized(data){}
// Return value:
{
  'success': Boolean,
  'error': String,
  'data': {}
}

Get First Parameters

Returns the data from the link that first referred the user. This is only set once, the first time the user is referred by a link.

Provide a callback function or otherwise a promise is returned.

↔️Median JavaScript Bridge

median.branch.getFirstParams({'callback': function})
// Return value
// see https://help.branch.io/using-branch/docs/creating-a-deep-link#data-structure

Get Latest Parameters

Returns the data from the link that referred the current session.

↔️Median JavaScript Bridge

median.branch.getLatestParams({'callback': function})
// Return value
// see https://help.branch.io/using-branch/docs/creating-a-deep-link#data-structure

Test Integration

Create a sample Quick Link on the Branch Dashboard, copy the generated link, paste it into the device messaging or notes app, and click the link. The user should be redirected to your app.