Branch Direct Web Portal

Overview

You can provide the ability for workers to sign up and use Branch in a browser, instead of the Branch mobile app, by using the Branch Direct Web Portal. This will step the Worker through the appropriate data collection and legal agreements to create their new Branch account.

The new Worker can choose whether disbursements are sent to their Branch Wallet for free, or directly to an existing debit card for a fee. If the Worker chooses to receive disbursements in a Branch Wallet, they will need to download the Branch App to access their funds and use the Branch card. If they choose to receive disbursements at an existing debit card, they can continue using Branch through the web portal at https://direct.branchapp.com/login

Implementation

URL Format

Construct the Branch Direct URL for the intended environment using the Organization's UUID. This URL can be directly provided to Workers. UUID in the URL has format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

  1. Production URL: https://direct.branchapp.com/?org_id={uuid}
  2. Staging URL: https://direct-stg.branchapp.com/?org_id={uuid}
  3. Sandbox URL: https://direct-sandbox.branchapp.com/?org_id={uuid}

JavaScript Web Implementation

  1. Add an iFrame to the HTML
    <iframe id="signup-widget"></iframe>
    
  2. Set the src to the Branch Direct URL constructed above in one of the following ways
    1. set the src attribute directly to the iframe in HTML for less scripting
      <iframe 
      id="signup-widget"
      src="https://direct-sandbox.branchapp.com/?org_id=73dc7099-a9f3-4048-8d8a-5af7a7d04dfe">
      </iframe>
      
    2. set the src attribute using JavaScript for dynamic configuration
      // The URL below is for the Branch Sandbox, choose the production, staging, or sandbox URL accordingly  
      var iFrameURL = "https://direct-sandbox.branchapp.com/?org_id=73dc7099-a9f3-4048-8d8a-5af7a7d04dfe";  
      document.getElementById("signup-widget").src = iFrameURL;
      

Android Kotlin Implementation

// The URL below is for the Branch Sandbox, choose the production or sandbox URL accordingly
val webPortalUrl = "https://direct-sandbox.branchapp.com/?org_id=73dc7099-a9f3-4048-8d8a-5af7a7d04dfe""

val webView = findViewById<WebView>(R.id.webView)

webView.settings.javaScriptEnabled = true
webView.settings.domStorageEnabled = true
webView.webViewClient = MyWebViewClient()

webView.loadUrl(webPortalUrl)

class MyWebViewClient : WebViewClient() {   
    override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
        return try {
            val intent = Intent(ACTION_VIEW, request.url).apply {
                addCategory(CATEGORY_BROWSABLE)
                flags = FLAG_ACTIVITY_NEW_TASK
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
                    addFlags(FLAG_ACTIVITY_REQUIRE_NON_BROWSER)
                }
            }
            context.startActivity(intent)
            true
        } catch (e: ActivityNotFoundException) {
            false
        }
    }
}

Example Web Portal Widget iFrame - Sandbox