Skip to content

An Android app example showing how to integrate our Twyn SDK to enroll face, fingerprints and interact with twyn backend

License

Notifications You must be signed in to change notification settings

nizarelouaer/twyn-sdk-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twyn

Your digital SSI

Apache 2.0 License Roadmap v1.0

Twyn SDK Integration

Twyn SDK is the T4ISB mobile SDK that allows the enrollment as well as the identity validation of a Twyn user.

Our aim is to protect the user identity and give him the total control of his biometric data and SSI identity.

Self Sovereign Identity (SSI)

As defined by WIKIPEDIA, SSI is an approach to digital identity that gives individuals control of their digital identities. We want to help people protect their data and their identity.

Enroll Person Face

Twyn SDK provides an activity to allow the person face enrollment. The client app has to implement EnrollFaceListener to be able to get the EnrollFaceResult. EnrollFaceResult has two atributes:

  1. livenessScore: face enrollment checks the face liveness and returns a score between 0 and 100. The score 100 is a 100% live face and 0 is a fake one
  2. croppedFace: face enrollment returns a cropped face (bitmap format) so that the client app can use it for verification/identitfication purposes

Below an example of calling the enroll face activity (Kotlin verison)

FaceActivity.setFaceListener(this)
val myIntent = Intent(this@MainActivity, FaceActivity::class.java)
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
myIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT)

startActivity(myIntent)

Once the face is enrolled, the client app will receive the result overriding the onEnrollFaceCompleted function:

    override fun onEnrollFaceCompleted(enrollFaceResult: EnrollFaceResult?) {
        if (enrollFaceResult != null) {
            runOnUiThread {
                Toast.makeText(
                    this@MainActivity,
                    "Successful Face Enrollment. Liveness Score ${enrollFaceResult.livenessScore}",
                    Toast.LENGTH_LONG
                ).show()
            }
        }
    }
    

Enroll Person Fingerprints

Twyn SDK provides an activity to allow the person fingerprints enrollment using the phone camera. The client app has to implement EnrollFingerListener to be able to get the EnrollFingersResult. EnrollFingersResult has three atributes:

  1. leftHandScore: A 0-100 Quality score of the left hand.
  2. rightHandScore: A 0-100 Quality score of the right hand.
  3. fingersMap: map containing the images of the enrolled fingerprints

Below an example of calling the enroll fingers activity (Kotlin verison)

FingerActivity.setEnrollFingerListener(this)
val myIntent = Intent(this@MainActivity, FingerActivity::class.java)
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
myIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT)
startActivity(myIntent)

Once the fingers are enrolled, the client app will receive the result overriding the onEnrollFingerCompleted function:

   override fun onEnrollFingerCompleted(enrollFingersResult: EnrollFingersResult) {
        val keys: Set<*> = enrollFingersResult.fingersMap.keys
        println("keys $keys")

        val i = keys.iterator()
        while (i.hasNext()) {
            val key = i.next() as String
            println("key $key")
            val value = enrollFingersResult.fingersMap[key]
            println("value $value")

        }

        runOnUiThread {
            Toast.makeText(
                this@MainActivity,
                "Left Hand Score  ${enrollFingersResult.leftHandScore} \n Right Hand Score ${enrollFingersResult.rightHandScore}",
                Toast.LENGTH_LONG
            ).show()
        }
    }
    

For more details please see the provided integration example.

Support or Contact

Having trouble with Pages? contact support and we’ll help you sort it out.

Contributors ✨

Thanks to the people who contributed to Twyn SDK:


Nizar Elouaer

💻

License

Twyn SDK is licensed under the Apache License, Version 2.0. View a copy of the License file.

About

An Android app example showing how to integrate our Twyn SDK to enroll face, fingerprints and interact with twyn backend

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages