Skip to content

Commit 989e250

Browse files
committed
Added Harry's comments
TODO: Add links to the Event Tracking for each SDK and add a section called Events Tracking.
1 parent 11c8ca7 commit 989e250

File tree

1 file changed

+196
-43
lines changed

1 file changed

+196
-43
lines changed

README.md

Lines changed: 196 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ The ComplyCube Flutter SDK makes it quick and easy to build a frictionless custo
77
## Table of contents
88

99
- [ComplyCube Flutter SDK](#complycube-flutter-sdk)
10-
- [Table of Contents](#table-of-contents)
10+
- [Table of contents](#table-of-contents)
1111
- [Features](#features)
12-
- [1. Requirements](#1-requirements)
13-
- [iOS](#ios)
14-
- [Android](#android)
15-
- [2. Installing the SDK](#2-installing-the-sdk)
16-
- [Flutter Package](#flutter-package)
17-
- [CocoaPods](#cocoapods)
18-
- [Android](#android-1)
19-
- [3. Usage](#3-usage)
20-
- [1. Creating a client](#1-creating-a-client)
12+
- [Requirements](#requirements)
13+
- [Getting Started](#getting-started)
14+
- [1. Installing the SDK](#1-installing-the-sdk)
15+
- [Flutter Package](#flutter-package)
16+
- [CocoaPods](#cocoapods)
17+
- [Application permissions](#application-permissions)
18+
- [iOS](#ios)
19+
- [Android](#android)
20+
- [2. Creating a client](#2-creating-a-client)
2121
- [Example request](#example-request)
2222
- [Example response](#example-response)
23-
- [2. Creating an SDK token](#2-creating-an-sdk-token)
23+
- [3. Creating an SDK token](#3-creating-an-sdk-token)
2424
- [Example request](#example-request-1)
2525
- [Example response](#example-response-1)
26-
- [3. Prepare stages](#3-prepare-stages)
27-
- [4. Client ID and token](#4-client-id-and-token)
28-
- [5. Widget Setup](#5-widget-setup)
26+
- [4. Prepare the SDK stages](#4-prepare-the-sdk-stages)
27+
- [5. Initialize the Flutter Widget](#5-initialize-the-flutter-widget)
2928
- [6. Perform checks](#6-perform-checks)
29+
- [Example response](#example-response-2)
3030
- [7. Setup webhooks and retrieve results](#7-setup-webhooks-and-retrieve-results)
3131
- [4. Customization](#4-customization)
3232
- [Stages](#stages)
@@ -36,11 +36,16 @@ The ComplyCube Flutter SDK makes it quick and easy to build a frictionless custo
3636
- [Selfie photo and video stage](#selfie-photo-and-video-stage)
3737
- [Proof of address stage](#proof-of-address-stage)
3838
- [Adding NFC Support](#adding-nfc-support)
39+
- [Pre-requisites (iOS)](#pre-requisites-ios)
3940
- [Appearance](#appearance)
4041
- [Localization](#localization)
4142
- [6. Result handling](#6-result-handling)
4243
- [7. Error handling](#7-error-handling)
43-
- [8. Going live](#8-going-live)
44+
- [Result errors](#result-errors)
45+
- [8. Custom Event handling](#8-custom-event-handling)
46+
- [Handled Events](#handled-events)
47+
- [9. Token expiry handler](#9-token-expiry-handler)
48+
- [10. Going live](#10-going-live)
4449
- [Additional info](#additional-info)
4550

4651
## Features
@@ -458,7 +463,48 @@ final settings = {
458463
```
459464

460465
#### Adding NFC Support
461-
To add NFC support to a document stage for some document types you need to add the following to your settings object:
466+
467+
With the ComplyCube SDK, you can read NFC-enabled identity documents and confirm their authenticity and identity.
468+
469+
To perform an NFC read, you'll first have to scan the document to obtain the necessary key for accessing the chip.
470+
471+
> :information_source: Please get in touch with your **Account Manger** or **[support](https://support.complycube.com/hc/en-gb/requests/new)** to get access to our NFC Enabled Mobile SDK.
472+
473+
The SDK supports the following features
474+
475+
- Basic access control
476+
- Secure messaging
477+
- Passive Authentication
478+
- Active authentication
479+
- Chip authentication
480+
481+
##### Pre-requisites (iOS)
482+
483+
> :information_source: To use this feature, your app must have the `Near Field Communication Tag Reading` capability enabled. To add this capability to your app, refer to [Apple's guide here](https://help.apple.com/xcode/mac/current/#/dev88ff319e7).
484+
485+
- You must add the following keys to your application `Info.plist` file:
486+
487+
```xml
488+
<key>NFCReaderUsageDescription</key>
489+
<string>Required to read from NFC enabled documents</string>
490+
```
491+
492+
- To read NFC tags correctly, you need to add the following entries to your app target's `Info.plist` file:
493+
494+
```xml
495+
<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
496+
<array>
497+
<string>12FC</string>
498+
</array>
499+
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
500+
<array>
501+
<string>A0000002471001</string>
502+
<string>A0000002472001</string>
503+
<string>00000000000000</string>
504+
<string>D2760000850101</string>
505+
</array>
506+
```
507+
462508

463509
```dart
464510
final settings = {
@@ -542,20 +588,19 @@ final settings = {
542588
```
543589

544590
Supported languages:
545-
- English - en 🇬🇧
546-
- French - fr 🇫🇷
547-
- German - de 🇩🇪
548-
- Italian - it 🇮🇹
549-
- Spanish - es 🇪🇸
550-
- Arabic - ar 🇦🇪
551-
- Dutch(Netherland) - nl 🇳🇱
552-
- Norwegian - no 🇳🇴
553-
- Polish - pl 🇵🇱
554-
- Portuguese - pt 🇵🇹
555-
- Swedish - sv 🇸🇪
556-
- Chinese - zh 🇨🇳
557-
558-
591+
- Arabic - `ar` :united_arab_emirates:
592+
- Dutch - `nl` :netherlands:
593+
- English - `en` :uk:
594+
- French - `fr` :fr:
595+
- German - `de` :de:
596+
- Hindi - `hi` :india:
597+
- Italian - `it` :it:
598+
- Norwegian - `no` :norway:
599+
- Polish - `po` :poland:
600+
- Portuguese - `pt` :portugal:
601+
- Spanish - `es` :es:
602+
- Swedish - `sv` :sweden:
603+
- Chinese (Simplified) - `zh` :cn:
559604

560605
## 6. Result handling
561606

@@ -591,19 +636,25 @@ If the SDK experiences any issues, an `ComplyCubeError` object is returned with
591636
You can implement the error handling as follows:
592637

593638
```dart
594-
void onCancelled() {
595-
print("The user cancelled");
596-
639+
void onCancelled(ComplyCubeError error) {
640+
switch (error.code) {
641+
case ComplyCubeErrorCode.NoConsentGiven:
642+
print("The user didn't give his conscent")
643+
break;
644+
case ComplyCubeErrorCode.UserExited:
645+
print("The user exited the verification flow")
646+
break;
647+
}
597648
}
598649
599650
600651
void onError(ComplyCubeError error) {
601652
// Managing errors based on code
602653
switch (error.code) {
603-
case ComplyCubeErrorCode.deleted_resource:
654+
case ComplyCubeErrorCode.DeletedResource:
604655
print("The resource has been deleted")
605656
break;
606-
case ComplianceErrorCode.limit_rate:
657+
case ComplianceErrorCode.LimitRate:
607658
print("The rate limit has been reached")
608659
break;
609660
// Add more cases for other error codes
@@ -614,16 +665,118 @@ void onError(ComplyCubeError error) {
614665
```
615666

616667
The following error codes are available:
668+
### Result errors
669+
670+
| Error | Description |
671+
| --- | ----------- |
672+
| ```ComplyCubeErrorCode.NotAuthorized``` | The SDK has attempted a request to an endpoint you are not authorized to use.|
673+
| ```ComplyCubeErrorCode.ExpiredToken``` | The token used to initialize the SDK has expired. Create a new SDK token and restart the flow. |
674+
| ```ComplyCubeErrorCode.DocumentMandatory``` | A **Document stage** is mandatory with the currently configured stages. |
675+
| ```ComplyCubeErrorCode.JailBroken``` | The SDK cannot be launched on this device as it has been compromised. |
676+
| ```ComplyCubeErrorCode.NoDocumentTypes``` | A **Document stage** has been initialized without setting document types. |
677+
| ```ComplyCubeErrorCode.BiometricStageCount``` | The configuration provided contains duplicate **Selfie photo** or **Selfie video** stages. |
678+
| ```ComplyCubeErrorCode.UploadError``` | An error occurred during the upload document or selfie upload process. |
679+
| ```ComplyCubeErrorCode.InvalidCountryCode``` | An invalid country code is provided. |
680+
| ```ComplyCubeErrorCode.UnsupportedCountryTypeCombination``` | An unsupported country code is provided for a specific document type. |
681+
| ```ComplyCubeErrorCode.Unknown``` | An unexpected error has occurred. If this keeps occurring, let us know about it. |
682+
| ```ComplyCubeErrorCode.FlowError``` | An unrecoverable error occurred during the flow.|
683+
684+
## 8. Custom Event handling
685+
686+
687+
Custom event handler
688+
689+
If you want to implement your own user tracking, the SDK enables you to insert your custom tracking code for the tracked events.
690+
691+
To incorporate your own tracking, define a function and apply it using withEventHandler when initializing the FlowBuilder:
692+
693+
```dart
694+
// onCustomEvent with event that contains event name
695+
void onCustomEvent(ComplyCubeCustomEvent event){
696+
switch(event.name){
697+
case 'BIOMETRICS_STAGE_SELFIE_CAMERA':
698+
print("The client reached capture camera for a selfie")
699+
break;
700+
}
701+
}
702+
703+
704+
ComplyCubeWidget(
705+
settings: settings,
706+
...
707+
onCustomEvent: onCustomEvent,
708+
...
709+
),
710+
711+
```
712+
713+
714+
### Handled Events
715+
Below is the list of events being tracked by the SDK:
716+
717+
| Event | Description |
718+
| --- | --- |
719+
| ```BIOMETRICS_STAGE_SELFIE_CAMERA``` | The client reached capture camera for a selfie. |
720+
| ```BIOMETRICS_STAGE_SELFIE_CAMERA_MANUAL_MODE``` | The client reached manual capture camera for a selfie. |
721+
| ```BIOMETRICS_STAGE_SELFIE_CAPTURE_GUIDANCE``` | The client has reached the guidance screen showing how to take a good selfie. |
722+
| ```BIOMETRICS_STAGE_SELFIE_CHECK_QUALITY``` | The client has reached the photo review screen after capturing a selfie photo.. |
723+
| ```BIOMETRICS_STAGE_VIDEO_ACTION_ONE``` | The client reached the first action in a video selfie |
724+
| ```BIOMETRICS_STAGE_VIDEO_ACTION_TWO``` | The client reached the second action in a video selfie. |
725+
| ```BIOMETRICS_STAGE_VIDEO_CAMERA``` | The client reached capture camera for a video selfie. |
726+
| ```BIOMETRICS_STAGE_VIDEO_CAMERA_MANUAL_MODE``` | The client reached manual capture camera for a video selfie. |
727+
| ```BIOMETRICS_STAGE_VIDEO_CHECK_QUALITY``` | The client has reached the video review screen after recording a video selfie. |
728+
| ```CAMERA_ACCESS_PERMISSION``` | The client has reached the permission request screen for camera permissions. |
729+
| ```COMPLETION_STAGE``` | The client has reached the Completion screen. |
730+
| ```CONSENT_STAGE``` | The client has reacher the consent stage screen. |
731+
| ```CONSENT_STAGE_WARNING``` | The client has attempted to exit without giving consent and receive a confirmation prompt. |
732+
| ```DOCUMENT_STAGE_TWO_SIDE_CHECK_QUALITY_BACK``` | The client reached quality preview screen for the back side of a two-sided ID document. |
733+
| ```DOCUMENT_STAGE_TWO_SIDE_CHECK_QUALITY_FRONT``` | The client reached quality preview screen for the front side of a two-sided ID document. |
734+
| ```DOCUMENT_STAGE_ONE_SIDE_CHECK_QUALITY``` | The client reached image quality preview screen for one-sided ID document. |
735+
| ```DOCUMENT_STAGE_TWO_SIDE_CAMERA_BACK``` | The client reached camera for the back side of a two-sided ID document. |
736+
| ```DOCUMENT_STAGE_TWO_SIDE_CAMERA_BACK_MANUAL_MODE``` | The client reached manual capture camera for the back side of two-sided ID document. |
737+
| ```DOCUMENT_STAGE_TWO_SIDE_CAMERA_FRONT``` | The client reached camera stage for the front side of two-sided ID document. |
738+
| ```DOCUMENT_STAGE_TWO_SIDE_CAMERA_FRONT_MANUAL_MODE``` | The client reached manual capture camera for the back side of two-sided ID document. |
739+
| ```DOCUMENT_STAGE_ONE_SIDE_CAMERA_MANUAL_MODE``` | The client reached manual capture camera of one-sided ID document. |
740+
| ```DOCUMENT_STAGE_ONE_SIDE_CAMERA``` | The client reached the capture camera stage for a one-sided ID document. |
741+
| ```DOCUMENT_STAGE_DOCUMENT_TYPE``` | The client has reached the document type selection screen for an ID Document capture stage. |
742+
| ```DOCUMENT_STAGE_SELECT_COUNTRY``` | The client reached country selection screen for ID document. |
743+
| ```DOCUMENT_STAGE_CAPTURE_GUIDANCE``` | The client reached capture guidance screen for ID document. |
744+
| ```INTRO``` | The client has reached the intro screen. |
745+
| ```PROOF_OF_ADDRESS_STAGE_TWO_SIDE_CHECK_QUALITY_FRONT``` | The client reached quality preview screen for the front side of a two-sided proof of address document. |
746+
| ```PROOF_OF_ADDRESS_STAGE_CAPTURE_GUIDANCE``` | The client has reach capture guidance screen for proof of address document. |
747+
| ```PROOF_OF_ADDRESS_STAGE_TWO_SIDE_CHECK_QUALITY_BACK``` | The client reached quality preview screen for the back side of a two-sided proof of address document. |
748+
| ```PROOF_OF_ADDRESS_STAGE_ONE_SIDE_CHECK_QUALITY``` | The client reached quality preview screen for a one-sided proof of address document. |
749+
| ```PROOF_OF_ADDRESS_STAGE_DOCUMENT_TYPE``` | The client has reached the document type selection screen for a Proof Of Address capture stage. |
750+
| ```PROOF_OF_ADDRESS_STAGE_ONE_SIDE_CAMERA``` | The client reached capture camera stage for a one-sided proof of address. |
751+
| ```PROOF_OF_ADDRESS_STAGE_TWO_SIDE_CAMERA_FRONT_MANUAL_MODE``` | The client reached manual capture camera for the front side of a two-sided proof address document. |
752+
| ```PROOF_OF_ADDRESS_STAGE_TWO_SIDE_CAMERA_FRONT``` | The client reached capture camera for the front side of a two-sided proof address document. |
753+
| ```PROOF_OF_ADDRESS_STAGE_TWO_SIDE_CAMERA_BACK_MANUAL_MODE``` | The client reached manual capture camera for the back side of a two-sided proof address document. |
754+
| ```PROOF_OF_ADDRESS_STAGE_ONE_SIDE_CAMERA_MANUAL_MODE``` | The client reached manual capture camera for the front side of a one-sided proof address document. |
755+
| ```PROOF_OF_ADDRESS_STAGE_SELECT_COUNTRY``` | The client reached country selection screen for a proof of address document. |
756+
| ```PROOF_OF_ADDRESS_STAGE_TWO_SIDE_CAMERA_BACK``` | The client reached camera for the back side of a two-sided proof address document. |
757+
758+
759+
## 9. Token expiry handler
760+
761+
If you want to automatically manage token expiration, you can use a callback function to generate a new token and seamlessly continue the process with it.
762+
```dart
763+
String onTokenExpiry(String token){
764+
// Insert custom token renewal code here
765+
String new_token = "The new token received";
766+
return new_token;
767+
}
768+
769+
ComplyCubeWidget(
770+
settings: settings,
771+
...
772+
onTokenExpiry: onTokenExpiry,
773+
...
774+
),
775+
776+
```
617777

618-
| Error code | Description |
619-
| ----------------------------- | ----------------------------------------------------------------------------|
620-
| resource_not_found | The requested resource is deleted. |
621-
| unauthorized | The 'Authorization' header is invalid |
622-
| invalid_request | A parameter has been missing |
623-
| rate_limit_exceeded | The rate limit has been reached |
624-
| internal_server_error | An internal server error has occurred |
625778

626-
## 8. Going live
779+
## 10. Going live
627780

628781
Check out our handy [integration checklist here](https://docs.complycube.com/documentation/guides/integration-checklist) before you go live.
629782

0 commit comments

Comments
 (0)