Commit 55c94b3e authored by Javohir Savriy's avatar Javohir Savriy
Browse files

Update README.md

parent 81a6ffde
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
......
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</component>
\ No newline at end of file
...@@ -130,7 +130,9 @@ Method | Notes | Default ...@@ -130,7 +130,9 @@ Method | Notes | Default
`withPassportData(value: String)` | Passport serial number or PINFL data | Optional `withPassportData(value: String)` | Passport serial number or PINFL data | Optional
`withBirthDate(value: String)` | Date of birth in. Format: `dd.MM.yyyy` | Optional `withBirthDate(value: String)` | Date of birth in. Format: `dd.MM.yyyy` | Optional
`withExternalId(value: String)` | 36 characters long. Should match with UUID4 regex | Optional `withExternalId(value: String)` | 36 characters long. Should match with UUID4 regex | Optional
`withThreshold(value: Float)` | The value can be in the range of `0.50` - `0.99` | 0.50
`withEntryType(value: MyIdEntryType)` | Customizing the SDK. Entry types: AUTH, FACE | MyIdEntryType.AUTH `withEntryType(value: MyIdEntryType)` | Customizing the SDK. Entry types: AUTH, FACE | MyIdEntryType.AUTH
`withOrganizationDetails(value: OrganizationDetails)` | Custom Organization Details | Optional
`withBuildMode(value: MyIdBuildMode)` | Build mode: DEBUG, PRODUCTION | MyIdBuildMode.PRODUCTION `withBuildMode(value: MyIdBuildMode)` | Build mode: DEBUG, PRODUCTION | MyIdBuildMode.PRODUCTION
`withLocale(value: MyIdLocale)` | To set a specific language | MyIdLocale.RU `withLocale(value: MyIdLocale)` | To set a specific language | MyIdLocale.RU
`withPhoto(value: Boolean)` | Return SDK face bitmap | false `withPhoto(value: Boolean)` | Return SDK face bitmap | false
...@@ -178,7 +180,7 @@ val resultListener: MyIdResultListener = object : MyIdResultListener { ...@@ -178,7 +180,7 @@ val resultListener: MyIdResultListener = object : MyIdResultListener {
| Attribute | Notes | | Attribute | Notes |
| -----|-------| | -----|-------|
| `onSuccess` | `MyIdResult` contains information about the face captures made during the flow and result code | | `onSuccess` | `MyIdResult` contains information about the face captures made during the flow, result code and comparison value. |
| `onUserExited` | User left the SDK flow without completing it. | | `onUserExited` | User left the SDK flow without completing it. |
| `onError` | Some error happened. `MyIdException` contains information about the error message and code | | `onError` | Some error happened. `MyIdException` contains information about the error message and code |
...@@ -229,3 +231,10 @@ The MyId Android SDK supports translations for the following languages: ...@@ -229,3 +231,10 @@ The MyId Android SDK supports translations for the following languages:
By default, the Russian language is used. However, you can also call the `withLocale(MyIdLocale)` By default, the Russian language is used. However, you can also call the `withLocale(MyIdLocale)`
method of the `MyIdConfig.Builder` configuration to set the language. method of the `MyIdConfig.Builder` configuration to set the language.
## Custom Organization Details
You can customize the SDK, for it to match your organization's brand book, by providing `OrganizationDetails` object to `withOrganizationDetails` method.
The object allows you to customize following fields:
- *phoneNumber* - by default 712022202, which is MyID's call center. If you would like the customer to call your own call center, you can display your own phone number on the error screen, by providing it in this field ([sample](images/screen01.jpg)).
- *logo* - the drawable asset, that will be displayed on the input screen. If you would like to display your own logo on the top of the screen, this is the place to provide it. Make sure it fits the imageView element, which has the *240x60* size.
...@@ -17,6 +17,7 @@ import uz.myid.android.sdk.capture.MyIdException; ...@@ -17,6 +17,7 @@ import uz.myid.android.sdk.capture.MyIdException;
import uz.myid.android.sdk.capture.MyIdLocale; import uz.myid.android.sdk.capture.MyIdLocale;
import uz.myid.android.sdk.capture.MyIdResult; import uz.myid.android.sdk.capture.MyIdResult;
import uz.myid.android.sdk.capture.MyIdResultListener; import uz.myid.android.sdk.capture.MyIdResultListener;
import uz.myid.android.sdk.capture.model.OrganizationDetails;
public class ExampleJavaActivity extends AppCompatActivity implements MyIdResultListener { public class ExampleJavaActivity extends AppCompatActivity implements MyIdResultListener {
...@@ -48,12 +49,20 @@ public class ExampleJavaActivity extends AppCompatActivity implements MyIdResult ...@@ -48,12 +49,20 @@ public class ExampleJavaActivity extends AppCompatActivity implements MyIdResult
String passportData = "passport_data"; String passportData = "passport_data";
String dateOfBirth = "date_of_birth"; String dateOfBirth = "date_of_birth";
String externalId = "external_id"; String externalId = "external_id";
float threshold = 0.5f;
OrganizationDetails organizationDetails = new OrganizationDetails(
"1234567",
R.drawable.image_logo
);
MyIdConfig myIdConfig = new MyIdConfig.Builder(clientId) MyIdConfig myIdConfig = new MyIdConfig.Builder(clientId)
.withPassportData(passportData) .withPassportData(passportData)
.withBirthDate(dateOfBirth) .withBirthDate(dateOfBirth)
.withExternalId(externalId) .withExternalId(externalId)
.withThreshold(threshold)
.withEntryType(MyIdEntryType.AUTH) .withEntryType(MyIdEntryType.AUTH)
.withOrganizationDetails(organizationDetails)
.withBuildMode(MyIdBuildMode.PRODUCTION) .withBuildMode(MyIdBuildMode.PRODUCTION)
.withLocale(MyIdLocale.EN) .withLocale(MyIdLocale.EN)
.withPhoto(false) .withPhoto(false)
......
...@@ -17,6 +17,7 @@ import uz.myid.android.sdk.capture.MyIdException; ...@@ -17,6 +17,7 @@ import uz.myid.android.sdk.capture.MyIdException;
import uz.myid.android.sdk.capture.MyIdLocale; import uz.myid.android.sdk.capture.MyIdLocale;
import uz.myid.android.sdk.capture.MyIdResult; import uz.myid.android.sdk.capture.MyIdResult;
import uz.myid.android.sdk.capture.MyIdResultListener; import uz.myid.android.sdk.capture.MyIdResultListener;
import uz.myid.android.sdk.capture.model.OrganizationDetails;
public class ExampleJavaFragment extends Fragment implements MyIdResultListener { public class ExampleJavaFragment extends Fragment implements MyIdResultListener {
...@@ -48,12 +49,20 @@ public class ExampleJavaFragment extends Fragment implements MyIdResultListener ...@@ -48,12 +49,20 @@ public class ExampleJavaFragment extends Fragment implements MyIdResultListener
String passportData = "passport_data"; String passportData = "passport_data";
String dateOfBirth = "date_of_birth"; String dateOfBirth = "date_of_birth";
String externalId = "external_id"; String externalId = "external_id";
float threshold = 0.5f;
OrganizationDetails organizationDetails = new OrganizationDetails(
"1234567",
R.drawable.image_logo
);
MyIdConfig myIdConfig = new MyIdConfig.Builder(clientId) MyIdConfig myIdConfig = new MyIdConfig.Builder(clientId)
.withPassportData(passportData) .withPassportData(passportData)
.withBirthDate(dateOfBirth) .withBirthDate(dateOfBirth)
.withExternalId(externalId) .withExternalId(externalId)
.withThreshold(threshold)
.withEntryType(MyIdEntryType.AUTH) .withEntryType(MyIdEntryType.AUTH)
.withOrganizationDetails(organizationDetails)
.withBuildMode(MyIdBuildMode.PRODUCTION) .withBuildMode(MyIdBuildMode.PRODUCTION)
.withLocale(MyIdLocale.EN) .withLocale(MyIdLocale.EN)
.withPhoto(false) .withPhoto(false)
......
package uz.myid.sdk.sample
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import uz.myid.android.sdk.capture.*
class ExampleKotlinActivity : AppCompatActivity(), MyIdResultListener {
private val client: MyIdClient = MyIdClient()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
startMyId()
}
override fun onSuccess(result: MyIdResult) {
// Get face bitmap and result code
}
override fun onError(e: MyIdException) {
// Get error message and code
}
override fun onUserExited() {
// User exited sdk
}
private fun startMyId() {
val clientId = "client_id"
val passportData = "passport_data"
val dateOfBirth = "date_of_birth"
val externalId = "external_id"
val myIdConfig = MyIdConfig.builder(clientId)
.withPassportData(passportData)
.withBirthDate(dateOfBirth)
.withExternalId(externalId)
.withEntryType(MyIdEntryType.AUTH)
.withBuildMode(MyIdBuildMode.PRODUCTION)
.withLocale(MyIdLocale.EN)
.withPhoto(false)
.build()
val intent = client.createIntent(this, myIdConfig)
result.launch(intent)
}
private val result = takeUserResult(this)
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package uz.myid.sdk.sample ...@@ -3,6 +3,7 @@ package uz.myid.sdk.sample
import android.os.Bundle import android.os.Bundle
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import uz.myid.android.sdk.capture.* import uz.myid.android.sdk.capture.*
import uz.myid.android.sdk.capture.model.OrganizationDetails
class ExampleKotlinFragment : Fragment(), MyIdResultListener { class ExampleKotlinFragment : Fragment(), MyIdResultListener {
...@@ -30,12 +31,20 @@ class ExampleKotlinFragment : Fragment(), MyIdResultListener { ...@@ -30,12 +31,20 @@ class ExampleKotlinFragment : Fragment(), MyIdResultListener {
val passportData = "passport_data" val passportData = "passport_data"
val dateOfBirth = "date_of_birth" val dateOfBirth = "date_of_birth"
val externalId = "external_id" val externalId = "external_id"
val threshold = 0.50f
val organizationDetails = OrganizationDetails(
phoneNumber = "1234567",
logo = R.drawable.image_logo
)
val myIdConfig = MyIdConfig.builder(clientId) val myIdConfig = MyIdConfig.builder(clientId)
.withPassportData(passportData) .withPassportData(passportData)
.withBirthDate(dateOfBirth) .withBirthDate(dateOfBirth)
.withExternalId(externalId) .withExternalId(externalId)
.withThreshold(threshold)
.withEntryType(MyIdEntryType.AUTH) .withEntryType(MyIdEntryType.AUTH)
.withOrganizationDetails(organizationDetails)
.withBuildMode(MyIdBuildMode.PRODUCTION) .withBuildMode(MyIdBuildMode.PRODUCTION)
.withLocale(MyIdLocale.EN) .withLocale(MyIdLocale.EN)
.withPhoto(false) .withPhoto(false)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment