Code Monkey home page Code Monkey logo

ios-verify's Introduction

Synaps verify

Swift Version Build Status License CocoaPods Compatible Platform PRs Welcome

Synaps is an all-in-one compliance platform. It offers a simple, fast and secure way to meet compliance requirements at scale.

Visit Synaps.io | Read the Synaps documentation

enter image description here

Installation

CocoaPods:

pod 'SynapsVerify'

Carthage:

github "synaps-io/ios-verify"

Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/synaps-io/ios-verify", from: "0.0.2")
]

Usage

import SynapsVerify

SwiftUI

...
@State private var sessionId = ""
var body: some View {
    ...
    VerifyView(
        sessionId: self.$sessionId,
        lang: .french,
    )
    ...

StoryBoard

How to setup it

The library allows you to use all the features of standard View with a lot of new cool features

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

Then set the View class to VerifyUiView and link your view to your variable of the same type in your ViewController

How to launch it

Swift

import UIKit
import SynapsVerify

class VerifyViewController : UIViewController {
    @IBOutlet weak var verifyView: VerifyUiView!

    var sessionId: String = ""

    override func viewDidLoad() {
        super.viewDidLoad()
        
        verifyView.startSession(sessionId: sessionId, lang: .french)
    }
}

You are free to use VerifyUiView without StoryBoard

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

Parameters list

Parameter name Parameter type Default Required Description
sessionId string '' Y Session can be referred as a customer verification session. More info
lang VerifyLang .english 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

Configuration

Avant de lancer une session Verify. Le projet de votre application a besoin de quelque configuration.

NFC

The application must declare the use of the NFC chip, and must have NFC entilement :

<key>com.apple.developer.nfc.readersession.formats</key>
<array>
    <string>TAG</string>
</array>

The Info.plist file must contain the field NFCReaderUsageDescription

Your application's Info.plist file must contain the application IDs needed to scan the documents.

<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
    <string>A0000002471001</string>
    <string>A0000002472001</string>
    <string>E80704007F00070302</string>
    <string>A000000167455349474E</string>
    <string>A0000002480100</string>
    <string>A0000002480200</string>
    <string>A0000002480300</string>
    <string>A00000045645444C2D3031</string>
    <string>D2760000850101</string>
    <string>00000000000000</string>
</array>

More informations here : https://developer.apple.com/documentation/corenfc/nfciso7816tag

Camera

The Info.plist file may contain the field NSCameraUsageDescription

To be able to take photos and analyze identification documents, the right to use the camera is required and must be claimed before building the Verify view (swiftui or UIKit). The Verify view will fire a warning if the rights are not acquired when the view is built.

AVCaptureDevice.requestAccess(
    for: .video,
    completionHandler: { accessGranted in
        ...
    }
)

Listner

Now you are ready to listen Verify event by using a callback

Swift UI

VerifyView(
    ...
)
.onReady {
    ...
}
.onFinished {
    ...
}

UIKit

verifyView.onReady {
    ...
}
verifyView.onFinished {
    ...
}

Listener list

Parameter name Parameter type Default Required Description
onReady () => Void null No Event listener called when the page is fully loaded
onFinished () => Void null No Event listener called when the user finished verification

Meta

@synaps

https://github.com/synaps-hub/ios-verify

ios-verify's People

Contributors

baillyjamy avatar riwanl8 avatar omarsy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.