Direct SDK Usage

A step-by-step guide on how to initialize Direct SDK on iOS.


Visit our Brankas Collection for iOS, to see a sample project of how to integrate the SDK.


Minimum Requirements

  1. Xcode 14 but preferably the latest version
  2. Minimum Target iOS Deployment: iOS 12
  3. Minimum Swift Tools Version: 5.3 but preferably the latest version

Installation & Updating

Please refer to the Installation page for iOS platform installation and update steps


  1. Call the initialize function from the Tap Framework and pass the API Key provided by Brankas.
import DirectTapFramework

DirectTapSF.shared.initialize(apiKey: "apiKey", isDebug: false)


Before calling any function, it is important to call the initialize function first to gain access to the checkout function. Also, by default, isDebug is set to false which uses the Production environment. To use the Sandbox environment, set the isDebug variable to true.


The Framework has a checkout function wherein it responds with a redirect url used to launch the Tap web application within built-in WKWebView or Safari Web Browser.

In order to use the checkout function, a DirectTapRequest is needed to be created and be passed. It has the following details:

  1. sourceAccount - the account to be used as a sender of money for bank transfer. It consists of DirectBankCode (code for a specific bank) and Country (country of origin)


If bankCode is set to nil, an internal bank selection screen will be shown inside Tap web application. If it has been filled up, that bank would automatically be selected instead.

  1. destinationAccountId - the ID of the registered account of the receiver of money for bank transfer. This is provided by Brankas. Each registered account has a corresponding ID.

  2. amount - the amount of money to be transferred. It consists of Currency (the currency of the money to be transferred) and numInCents - amount in centavos (e.g. If value to be transferred is PHP 1, the value to be passed in amount should be "100" - value is multiplied by 100).

  3. memo - the note or description attached to the bank transfer

  4. customer - pertains to the details of the sender of money. It consists of firstName, lastName, email and mobileNumber

  5. referenceId

  6. client - pertains to the customizations in the Tap Web Application and callback url once bank transfer is finished. It consists of;

  • displayName- name in the header to be shown in the Tap Web Application.
  • logoUrl- URL of the logo to be shown.
  • returnUrl- URL where Tap would be redirecting after bank transfer is finished.
  • failUrl- Optional URL where Tap would be redirecting if bank transfer has failed.
  • statementRetrieval- Bool that shows the list of statements after bank transfer is finished; its default value is false.
  1. browserMode - Safari (Tap Web Application is launched through Safari Web Browser) and WebView (Tap Web application is launched through the built-in WKWebView from the Framework, this is the default value)


When using the WebView BrowserMode, ensure that the ViewController to be passed in the checkout function is attached to a UINavigationController so that the Framework can provide a back button.

  1. dismissAlert - pertains to the showing of alert dialog when closing the WebView. It consists of message, positiveButtonText and negativeButtonText. Just set this value to null to remove the alert dialog when closing the application.

  2. useRememberMe - pertains to using the remember me feature of the Tap Web Application (default value is true and will not be showing up if set to false)

  3. expiryDate - refers to the expiry time of the created invoice

  4. uniqueAmount - refers to the enabling of centavo reconciliation workaround logic

Here is a sample on how to use it and call:

import UIKit
import DirectTapFramework

class ViewController: UIViewController {
    override func viewDidLoad() {
        // Do any additional setup after loading the view.
        DirectTapSF.shared.initialize(apiKey: "hjkozDM1YcaE00q60T2qCj3s4Pb1ui0p3K2V6hjyu5AxR7A8E0IAK5G1u4sRrbcH5", certPath: nil, isDebug: true)
        let account = Account(country: Country.PH)
        let amount = Amount(currency: Currency.php, numInCents: "10000")
        let customer = Customer(firstName: "First", lastName: "Last", email: "[email protected]", mobileNumber: "63")
        var client = Client()
        client.displayName = "Display Name"
        client.returnUrl = ""
	var request = DirectTapRequest(sourceAccount: account, destinationAccountId: "5887e376-383c-11eb-b400-4hsddb0c633ac", amount: amount, memo: "Bank Transfer", customer: customer, referenceId: "sample-reference", client: client, dismissAlert: DismissAlert(message: "Do you want to close the application?", confirmButtonText: "Yes", cancelButtonText: "Cancel"))
        request.browserMode = TapRequest.BrowserMode.WebView
        do {
            let result = { (data: DirectTapFramework.Transaction?, error: String?) in
        	if let transaction = data {
            		print("TRANSACTION ID: \(")
        	if let err = error {
            		print("Error Logs: \(err)")
            try DirectTapSF.shared.checkout(tapRequest: request, vc: self, closure: result)
        } catch {
            print("Error: \(error)")


To check if the transaction is successful or not, check the status from the Transaction object.

App Tracking Transparency

Apple introduced this new feature, starting iOS 14.5. Users can decide whether the current app being used will be given a permission to track activity and usage for the purposes of advertising and data sharing. With this, iOS mobile applications have to abide certain guidelines created by Apple ( to ensure security and privacy of its users. Each iOS application should inform its users if sensitive information should be used through the App Tracking Transparency Framework.

Logging of Tap Web Flow

This new feature has been added internally, starting v4.0 of Direct Tap Framework. Brankas can track the flow of a transaction while performing a Fund Transfer within Tap Web App. This will aid in pointing out some errors within transactions and eventually improve the overall experience.

How necessary to integrate App Tracking Transparency Framework

It is not needed to integrate this Framework when using Direct Tap Framework. It is ensured that no private information of users is being sent. The logging system can only track the transaction flow but will not be able to determine from which user it belongs to specifically. The data will only be used for checking inconsistencies within a transaction flow. We ensure that it will not be shared nor will be used for advertisement.

How to turn off the logging feature

The logging feature is enabled by default. To turn off the feature, you can change the value of isLoggingEnabled within the initialize() function as the below sample;

import DirectTapFramework

DirectTapSF.shared.initialize(apiKey: "apiKey", isDebug: false, isLoggingEnabled: false)

How to integrate App Tracking Transparency Framework

The developer has to create the code manually within the mobile application. Below is a sample integration:

import DirectTapFramework

    private func showTrackingPermission() {
        if #available(iOS 14, *) {
            ATTrackingManager.requestTrackingAuthorization { status in
                switch status {
                    case .authorized:
			DirectTapSF.shared.initialize(apiKey: "apiKey", isDebug: false, isLoggingEnabled: true)
                    case .denied:
                    case .notDetermined:
                    case .restricted:
			DirectTapSF.shared.initialize(apiKey: "apiKey", isDebug: false, isLoggingEnabled: false)
			DirectTapSF.shared.initialize(apiKey: "apiKey", isDebug: false, isLoggingEnabled: false)