Berbix Docs

Welcome to the Berbix docs! Here you’ll find comprehensive information for integrating Berbix Verify and its associated APIs as well as an overview of Berbix Dashboard functionality.

The fastest way to integrate Berbix Verify is to follow our Integration Guide, which walks through your entire Berbix integration step-by-step. You’ll integrate Berbix Verify into your site or app and then use one of our SDKs to retrieve the data you need from our API. You'll also be guided through the configuration of verification workflow rules to map to your existing business logic.

You can see the full Berbix Verify API specification in our API Reference Docs and find functional documentation for the Berbix Dashboard here.

If you have any questions, please don't hesitate to reach out to us at [email protected] or via your organization's shared Slack channel.

Docs & Guides    API Reference

iOS

Install via CocoaPods

In your Podfile, ensure the berbix-ios-spec Cocoapod spec repository is added to your sources and then add Berbix as one of your target dependencies.

target 'YourProject' do
  source 'https://github.com/CocoaPods/Specs.git'
  source 'https://github.com/berbix/berbix-ios-spec.git'

  pod 'Berbix', '1.0.7'
end

In addition to importing the Cocoapod dependency, you will also need to set the Privacy - Camera Usage Description in your Info.plist to enable camera access.

Usage

To initialize the Berbix Verify flow, refer to the code sample below and include your client_token in place of client_token_for_session. Please see our Integration Guide for more details on initializing the Berbix Verify flow and integrating Berbix APIs.

class ViewController : UIViewController, BerbixSDKDelegate {
  
    // This is hooked up to a button which starts the flow
    @IBAction func buttonPressed(_ sender: UIButton) {
        let berbixSDK = BerbixSDK()
        let config = BerbixConfigurationBuilder()
            .withClientToken("client_token_for_session")
            .build()
        berbixSDK.startFlow(self, delegate: self, config: config)
    }

    func completed() {
        // Send request to server to fetch verification status
    }
    
    func failed(error: BerbixError) {
        // Something went wrong in the execution of the flow
    }

}

Reference

BerbixSDK Methods

constructor()

Constructs a Berbix SDK client. This can be used subsequently to invoke the Berbix flow within your app.

startFlow(_ vc: UIViewController, delegate: BerbixSDKDelegate, config: BerbixConfiguration)

Starts the Berbix flow and immediately takes control of the user interface. This is the most basic invocation of the flow. Upon completion of the flow, the user interface control will be returned to the app and the onComplete adapter method will be called. Upon any irrecoverable error, the onError adapter method will be called.

createSession(delegate: BerbixSDKDelegate, config: BerbixConfiguration, ready: @escaping () -> Void) -> BerbixSessionHandle

Creates a Berbix session but does not immediately take control of the user interface. When the session is created, ready will be run. At that point, the user interface can be rendered immediately by calling the associated display method. Returns a session handle that can be used to invoke the display method.

display(_ vc: UIViewController, handle: BerbixSessionHandle)

Takes immediate control of the user interface and begins the Berbix flow. This must be called in conjunction with createSession after the associated ready callback runs.

BerbixSDKConfigurationBuilder Methods

constructor()

Creates a new options builder with the default initial state.

withClientToken(_ clientToken: String) -> BerbixConfigurationBuilder

Sets the client token for the session. This value is fetched from the Berbix API upon creation of a transaction.

Updated 3 months ago

iOS


Suggested Edits are limited on API Reference Pages

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