IOS

In this section, we will see how to integrate your Verify with Synaps component easily.

If you need any assistance, don't hesitate to contact technical support at riwan@synaps.io

1. Install

pod 'SynapsVerify'

2. Usage

1. SwiftUI

...
@State private var sessionId = ""
var body: some View {
    ...
    Synaps(sessionId: self.$sessionId, 
                   primaryColor: .blue,
                   secondaryColor: .white, ready: {
                       print("ready")
                   }, finished: {
                       print("finished")
                   })
    ...

Parameters list

Parameter nameParameter typeDefaultRequiredDescription

sessionId

string

''

Y

Session can be referred as a customer verification session. More info

type

string

'individual'

N

individual - for know your customer corporate - for know your business

lang

string

'en'

N

You can set a predefined language for your user. Synaps already take advantage of browser language to display the relevant language to the end-user but if your user has set up a language option to your website, you can definitely pass it as an option.

tier

int

null

N

Tier is a simply way to divide your workflow into small pieces. It is very useful when you offer different features based on the verification level of your customer. More info

primaryColor

color

null

N

You can set a primary color, it will create a verification flow tailored to your compliance needs and your brand.

secondaryColor

color

null

N

You can set a secondary color, it will create a verification flow tailored to your compliance needs and your brand.

ready

() => void

null

Y

Event listener called when the page is fully loaded

finished

() => void

null

Y

Event listener called when the user finished verification

3. Storyboard

How to setup it

The library allows you to use all the features of standard View with a lot of new cool features, customizable from Storyboard or from code.

First of all, drag & drop a new View inside your view controller in storyboard.

Then set the View class to UISynapsIndividual or UISynapsCorporate

Now you are ready to customize your UISynapsIndividual or UISynapsCorporate from the `Attributes Inspector` of Interface Builder.

Attributes

Attribute nameAttribute typeDefaultRequiredDescription

Lang

string

'en'

N

You can set a predefined language for your user. Synaps already take advantage of browser language to display the relevant language to the end-user but if your user has set up a language option to your website, you can definitely pass it as an option.

Tier

int

null

N

Tier is a simply way to divide your workflow into small pieces. It is very useful when you offer different features based on the verification level of your customer. More info

Primary color

color

null

N

You can set a primary color, it will create a verification flow tailored to your compliance needs and your brand.

Secondary Color

color

null

N

You can set a secondary color, it will create a verification flow tailored to your compliance needs and your brand.

How to launch it

import SynapsVeriy
import AVFoundation
class ViewController: UIViewController {
    
    @IBOutlet var synaps : UISynapsIndividual!
    override func viewDidLoad() {
        super.viewDidLoad()
        ...
    }
     func yourSessionHandler() {
        switch AVCaptureDevice.authorizationStatus(for: .video) {
            case .authorized:
            synaps.sessionId = SESSION_ID
            case .notDetermined: 
                AVCaptureDevice.requestAccess(for: .video) { granted in
                    if granted {
                        self.synaps.sessionId = SESSION_ID
                    }
                }
           ...
        }
    }

First of all, you should set the session id. Session Id can be referred as a customer verification session. More info

Now you are ready to listen Synaps event by listening the event Value Changed

@IBAction func onStatusChanged(sender: UISynapsIndividual) {
    if self.synaps.status == "ready" {
        ...
    } else if self.synaps.status == "finished" {
        ...
    }
}

ready: when the page is fully loaded

finished: when the user finished verification

What is Individual or Corporate ?

If you want to know more about what is individual (KYC) or what is corporate (KYB) and how to set them up you can click on these two links:

IndividualCorporate

session_id ?

To get a session_id you need to create an app on Synaps Manager. Once you selected your service type, you will have to go in your "integration" tab and copy your Api-Key.

The Api-Key MUST NOT be stored in your frontend. You have to store it on your server and never on the client side. The only thing that should be exposed to the user is the session_id.

To create a session_id, you have to call the API related to the service you chose. For instance, if you chose Identity service, go to Identity > Sessions in the documentation.

Session Creation

Customization

Custom colors

We give you the possibility to customize your workflow with your colors. You can set a primary color and a secondary color, it will create a verification flow tailored to your compliance needs and your brand.

Synaps(
...
primaryColor: .blue,
secondaryColor: .white, 
...
 })

Custom language

You can set a predefined language for your user. Synaps already take advantage of browser language to display the relevant language to the end-user but if your user has set up a language option to your website, you can definitely pass it as an option.

Synaps(
...
primaryColor: .blue,
secondaryColor: .white, 
...
 })

Custom tiers

As explained before in the documentation, tiers is a simply way to divide your workflow into small pieces. It is very useful when you offer different features based on the verification level of your customer.

To create your own tier, check out the step-by-step guide

Tiers

Once created, you will have your tier , You will have to pass it in the options objects while initialising the SDK.

Synaps(
...
tier: '123333'
...
 })

Last updated