uqudo
HomeCustomer PortalBook a Demo
  • KYC
    • Getting Started
      • Use Cases
        • User Enrolment
        • Face Authentication
      • Integration Options
        • Uqudo SDK
        • Uqudo API
        • No-code KYC
      • Customer Portal
        • Manage your SDK/API credentials
        • Create a new secret
        • Create a support request
    • Uqudo SDK
      • Integration
        • Android
          • Prepare Environment
          • Enrolment Flow
          • Lookup Flow
          • Face Session Flow
          • UI Customisation
            • UX & Branding
            • Dark / Night mode
            • Text & Language
              • General Strings
              • Scanning
              • Reading
              • Face Recognition
              • Background Check
              • Lookup
          • Analytics
        • iOS
          • Prepare Environment
          • Usage
          • Enrolment Flow
          • Lookup Flow
          • Face Session Flow
          • UI Customisation
            • UX & Branding
            • Dark / Night mode
            • Text & Language
          • Analytics
        • Web
          • SDK installation
            • Vanilla HTML+JS project
            • JS Frameworks (React, Angular, VueJs, etc...)
          • SDK Initialisation
          • CORS
          • Enrolment Flow
          • Face Session Flow
          • Javascript Usage
          • Typescript Usage
          • Operation Error
          • UI Customisation
            • Styles Configuration
            • Text & Language
            • Assets & Images
          • Webview Usage
          • Analytics
        • Capacitor
          • Plugin Installation
          • Enrolment Flow
          • Lookup Flow
          • Face Session Flow
        • Cordova
          • Plugin Installation
          • Enrolment Flow
          • Lookup Flow
          • Face Session Flow
        • Flutter
          • Plugin Installation
          • Enrolment Flow
          • Lookup Flow
          • Face Session Flow
        • React Native
          • Plugin Installation
          • Enrolment Flow
          • Lookup Flow
          • Face Session Flow
        • Xamarin and .NET
          • Plugin Installation
          • Enrolment Flow
          • Lookup Flow
          • Face Session Flow
          • Analytics
      • SDK result
        • Validation and Parsing
        • Data Structure
          • Common Object
          • Scan Object
          • Reading Object
            • Algerian ID
            • Bahrain ID
            • Ghana ID
            • Iraqi ID
            • Netherlands DL
            • Oman ID
            • Moroccan ID
            • Qatar ID
            • Saudi ID
            • Senegal ID
            • Turkish ID
            • UAE ID
            • Passports
          • Face Object
          • Lookup Object
            • Ghana SSNIT
            • Ghana Voter ID
            • Ghana Passport
            • Ghana Driving Licence
            • India PAN card
            • India Aadhaar ID
            • Nigeria Voter ID
            • Nigeria Driving Licence
            • Nigeria NIN
            • Nigeria BVN
            • Kenya National ID
            • South Africa ID
            • Uganda Voter ID
            • UAE Emirates ID
          • Verification Object
        • Download a Resource
        • Encrypt the SDK result
        • Security & Best Practices
      • Upgrade the SDK
      • Changelog
        • Mobile SDK
        • Web SDK
    • Uqudo API
      • Authorisation API
      • Scan API
        • Passports
          • AUS (Australia)
          • BEL (Belgium)
          • BHR (Bahrain)
          • CAN (Canada)
          • CHE (Switzerland)
          • DEU (Germany)
          • EGY (Egypt)
          • FRA (France)
          • GBR (UK)
          • IND (India)
          • JOR (Jordan)
          • KWT (Kuwait)
          • LBN (Lebanon)
          • MAR (Morocco)
          • OMN (Oman)
          • PAK (Pakistan)
          • PHL (Philippines)
          • PSE (Palestine)
          • QAT (Qatar)
          • SAU (Saudi Arabia)
          • SDN (Sudan)
          • SYR (Syria)
          • TUN (Tunisia)
          • TUR (Turkey)
          • UAE (UAE)
          • USA (USA)
          • YEM (Yemen)
          • ZAF (South Africa)
        • Generic National IDs
        • Country Specific IDs
          • BHR_DL (Bahrain Driving Licence)
          • BHR_ID (Bahrain ID)
          • BHR_VL (Bahrain Vehicle License)
          • COD_DL (DRC Driving Licence)
          • COD_VOTER_ID (DRC Voter ID)
          • DZA_ID (Algerian ID)
          • EGY_ID (Egypt ID)
          • GBR DL (UK Driving License)
          • GBR_ID (UK Resident ID)
          • GHA_DL (Ghana Driving Licence)
          • GHA_ID (Ghana National ID)
          • GHA_SSNIT (Ghana Social Security and National Insurance Trust)
          • GHA_VOTER_ID (Ghana Voter ID)
          • IND_ID (India Identity Card)
          • IND_PAN (Indian PAN Card)
          • IRQ_ID (Iraqi ID)
          • JOR_VL (Jordan Vehicle License)
          • KEN_ID (Kenya ID)
          • KWT_ID (Kuwait ID)
          • LBN DL (Lebanese Driving Licence)
          • LBN_ID (Lebanese ID)
          • MAR_ID (Moroccan ID)
          • NGA_DL (Nigeria Driving Licence)
          • NGA_NIN (Nigeria Digital NIN)
          • NGA_VOTER_ID (Nigeria Voter Card)
          • NLD_DL (Netherlands Driving Licence)
          • OMN_DL (Oman Driving Licence)
          • OMN_ID (Oman ID)
          • OMN_VL (Oman Vehicle License)
          • PAK_ID (Pakistan ID)
          • PHL_DL (Philippines Driving License)
          • QAT_DL (Qatar Driving Licence)
          • QAT_ID (Qatar ID)
          • RSL_ID (Somaliland National ID)
          • RWA_ID (Rwanda ID)
          • SAU_DL (Saudi Arabia Driving Licence)
          • SAU_ID (Saudi Arabia ID)
          • SAU_VL (Saudi Vehicle License)
          • SDN_DL (Sudan Driving Licence)
          • SDN_ID (Sudan ID)
          • SDN_VL (Sudan Vehicle License)
          • SEN_ID (Senegal ID)
          • SOM_ID (Somali ID)
          • TUN_ID (Tunisian ID)
          • TUR_ID (Turkish ID)
          • UAE_DL (UAE Driving Licence)
          • UAE_ID (UAE Emirates ID)
          • UAE_ID_DIGITAL (UAE Emirates ID digital version)
          • UAE_VISA (UAE Visa)
          • UAE_VL (UAE Vehicle Licence)
          • UAE_EVISA (UAE e-visa)
          • UAE_ID_APPLICATION_FORM (UAE ID application form)
          • UAE_PASSPORT_DIGITAL (Digital Emirates Passport)
          • UGA_ID (Uganda ID)
          • UGA_VOTER_ID (Uganda Voter ID)
          • USA_DL (USA Driving Licence)
          • ZAF_DL (South Africa Driving License)
          • ZAF_ID (South Africa ID)
        • MRZ only (TD1 or TD3)
      • Info API
      • Face API
      • Lookup API
        • Ghana
        • India
        • Kenya
        • Nigeria
        • South Africa
        • Uganda
        • UAE
      • Background Check API
    • No-code KYC
      • Workflow Settings
      • Text Settings
      • Other Settings
      • Onboard Users
  • KYB
    • Getting Started
      • Use Cases
        • Low-complexity
        • Medium-complexity
        • High-complexity
      • Integration Options
        • Uqudo API
    • Uqudo API
      • Company API
      • Screening API
      • Data Matching API
      • Session API
  • Coverage
    • Middle East
      • 🇧🇭Bahrain
      • 🇮🇷Iran
      • 🇮🇶Iraq
      • 🇮🇱Israel
      • 🇯🇴Jordan
      • 🇰🇼Kuwait
      • 🇱🇧Lebanon
      • 🇴🇲Oman
      • 🇵🇸Palestine
      • 🇶🇦Qatar
      • 🇸🇦Saudi Arabia
      • 🇸🇾Syria
      • 🇹🇷Turkey
      • 🇦🇪United Arab Emirates
      • 🇾🇪Yemen
    • Africa
      • 🇩🇿Algeria
      • 🇦🇴Angola
      • 🇧🇯Benin
      • 🇧🇼Botswana
      • 🇧🇫Burkina Faso
      • 🇧🇮Burundi
      • 🇨🇲Cameroon
      • 🇨🇻Cape Verde
      • 🇨🇫Central African Republic
      • 🇹🇩Chad
      • 🇰🇲Comoros
      • 🇨🇩Democratic Republic of Congo
      • 🇩🇯Djibouti
      • 🇪🇬Egypt
      • 🇬🇶Equatorial Guinea
      • 🇪🇷Eritrea
      • 🇸🇿Eswatini
      • 🇪🇹Ethiopia
      • 🇬🇦Gabon
      • 🇬🇲Gambia
      • 🇬🇭Ghana
      • 🇬🇳Guinea
      • 🇬🇼Guinea-Bissau
      • 🇨🇮Ivory Coast
      • 🇰🇪Kenya
      • 🇱🇸Lesotho
      • 🇱🇷Liberia
      • 🇱🇾Libya
      • 🇲🇬Madagascar
      • 🇲🇼Malawi
      • 🇲🇱Mali
      • 🇲🇷Mauritania
      • 🇲🇺Mauritius
      • 🇲🇦Morocco
      • 🇲🇿Mozambique
      • 🇳🇦Namibia
      • 🇳🇪Niger
      • 🇳🇬Nigeria
      • 🇨🇩Republic of Congo
      • 🇷🇼Rwanda
      • 🇸🇹Sao Tome and Principe
      • 🇸🇳Senegal
      • 🇸🇨Seychelles
      • 🇸🇱Sierra Leone
      • 🇸🇴Somalia
      • 🇸🇴Somaliland
      • 🇿🇦South Africa
      • 🇸🇸South Sudan
      • 🇸🇩Sudan
      • 🇹🇿Tanzania
      • 🇹🇬Togo
      • 🇹🇳Tunisia
      • 🇺🇬Uganda
      • 🇿🇲Zambia
      • 🇿🇼Zimbabwe
    • Asia
      • 🇦🇫Afghanistan
      • 🇦🇲Armenia
      • 🇦🇿Azerbaijan
      • 🇧🇩Bangladesh
      • 🇧🇹Bhutan
      • 🇧🇳Brunei
      • 🇰🇭Cambodia
      • 🇨🇳China
      • 🇹🇱East Timor
      • 🇬🇪Georgia
      • 🇭🇰Hong-Kong (China)
      • 🇮🇳India
      • 🇮🇩Indonesia
      • 🇯🇵Japan
      • 🇰🇿Kazakhstan
      • 🇰🇬Kyrgyzstan
      • 🇱🇦Laos
      • 🇲🇴Macau (China)
      • 🇲🇾Malaysia
      • 🇲🇻Maldives
      • 🇲🇳Mongolia
      • 🇲🇲Myanmar
      • 🇳🇵Nepal
      • 🇰🇵North Korea
      • 🇵🇰Pakistan
      • 🇵🇭Philippines
      • 🇸🇬Singapore
      • 🇰🇷South Korea
      • 🇱🇰Sri Lanka
      • 🇹🇼Taiwan (China)
      • 🇹🇯Tajikistan
      • 🇹🇭Thailand
      • 🇹🇲Turkmenistan
      • 🇺🇿Uzbekistan
      • 🇻🇳Vietnam
    • Europe
      • 🇦🇱Albania
      • 🇦🇩Andorra
      • 🇦🇹Austria
      • 🇧🇾Belarus
      • 🇧🇪Belgium
      • 🇧🇦Bosnia and Herzegovina
      • 🇧🇬Bulgaria
      • 🇭🇷Croatia
      • 🇨🇾Cyprus
      • 🇨🇿Czech Republic
      • 🇩🇰Denmark
      • 🇪🇪Estonia
      • 🇫🇴Faroe Islands (Denmark)
      • 🇫🇮Finland
      • 🇫🇷France
      • 🇩🇪Germany
      • 🇬🇮Gibraltar (UK)
      • 🇬🇷Greece
      • 🇬🇱Greenland (Denmark)
      • 🇬🇬Guernsey (UK)
      • 🇭🇺Hungary
      • 🇮🇸Iceland
      • 🇮🇪Ireland
      • 🇮🇲Isle of Man (UK)
      • 🇮🇹Italy
      • 🇯🇪Jersey (UK)
      • 🇽🇰Kosovo
      • 🇱🇻Latvia
      • 🇱🇮Liechtenstein
      • 🇱🇹Lithuania
      • 🇱🇺Luxembourg
      • 🇲🇹Malta
      • 🇲🇩Moldova
      • 🇲🇨Monaco
      • 🇲🇪Montenegro
      • 🇳🇱Netherlands
      • 🇲🇰North Macedonia
      • 🇨🇾Northern Cyprus
      • 🇳🇴Norway
      • 🇵🇱Poland
      • 🇵🇹Portugal
      • 🇷🇴Romania
      • 🇷🇺Russia
      • 🇸🇲San Marino
      • 🇷🇸Serbia
      • 🇸🇰Slovakia
      • 🇸🇮Slovenia
      • 🇪🇸Spain
      • 🇸🇪Sweden
      • 🇨🇭Switzerland
      • 🇺🇦Ukraine
      • 🇬🇧United Kingdom
      • 🇻🇦Vatican City
    • North America
      • 🇦🇮Anguilla (UK)
      • 🇦🇬Antigua and Barbuda
      • 🇧🇸Bahamas
      • 🇧🇧Barbados
      • 🇧🇿Belize
      • 🇧🇲Bermuda (UK)
      • 🇻🇬British Virgin Islands (UK)
      • 🇨🇦Canada
      • 🇰🇾Cayman Islands (UK)
      • 🇨🇷Costa Rica
      • 🇨🇺Cuba
      • 🇩🇲Dominica
      • 🇩🇴Dominican Republic
      • 🇸🇻El Salvador
      • 🇬🇩Grenada
      • 🇬🇹Guatemala
      • 🇭🇹Haiti
      • 🇭🇳Honduras
      • 🇯🇲Jamaica
      • 🇲🇽Mexico
      • 🇲🇸Montserrat (UK)
      • 🇵🇦Panama
      • 🇰🇳Saint Kitts and Nevis
      • 🇱🇨Saint Lucia
      • 🇻🇨Saint Vincent and the Grenadines
      • 🇹🇨Turks and Caicos Islands (UK)
      • 🇺🇸United States of America
    • South America
      • 🇦🇷Argentina
      • 🇧🇴Bolivia
      • 🇧🇷Brazil
      • 🇨🇱Chile
      • 🇨🇴Colombia
      • 🇪🇨Ecuador
      • 🇬🇾Guyana
      • 🇳🇮Nicaragua
      • 🇵🇾Paraguay
      • 🇵🇪Peru
      • 🇸🇷Suriname
      • 🇹🇹Trinidad and Tobago
      • 🇺🇾Uruguay
      • 🇻🇪Venezuela
    • Oceania
      • 🇦🇺Australia
      • 🇫🇯Fiji
      • 🇵🇫French Polynesia (France)
      • 🇰🇮Kiribati
      • 🇲🇭Marshall Islands
      • 🇫🇲Micronesia
      • 🇳🇷Nauru
      • 🇳🇨New Caledonia (France)
      • 🇳🇿New Zealand
      • 🇵🇼Palau
      • 🇵🇬Papua New Guinea
      • 🇸🇭Saint Helena (UK)
      • 🇼🇸Samoa
      • 🇸🇧Solomon Islands
      • 🇹🇴Tonga
      • 🇹🇻Tuvalu
      • 🇻🇺Vanuatu
Powered by GitBook
On this page

Was this helpful?

  1. KYC
  2. Uqudo SDK
  3. Integration
  4. iOS

Analytics

The SDK provides an interface that you can implement and that will be used by the SDK to send events. The interface is simply the one below:

@interface UQTracer : NSObject
- (void)trace:(UQTrace *)trace;
@end

Trace is the object passed to your implementation and you can use it with any of your analytics tools or any custom tracing mechanism. Make sure to avoid blocking calls if you push the information of the trace object to any external system.

The UQTrace object has the following properties:

Property
Type
Optional
Default

deviceIdentifier

String

No

None

This value uniquely identifies multiple sessions from a given device (persisting until the app is reinstalled)

sessionId

String

No

None

Session id (UUID v4) created by the SDK or passed by your application

category

UQTraceCategory

No

None

See below

event

UQTraceEvent

No

None

See below

status

UQTraceStatus

No

None

See below

page

UQTracePage

Yes

null

See below

statusCode

UQTraceStatusCode

Yes

null

See below

statusMessage

String

Yes

null

Description of the status code if any

documentType

DocumentTypeID

Yes

null

Document type id

timestamp

Date

No

Current date

Timestamp of the event

deviceIdentifier

UUID

No

None

This value uniquely identifies all sessions from a given device (persisting until the app is reinstalled). You may still use more specific identifiers, such as phone number or email, if you already know the user. Available from SDK version 3.4.1 and above.

UQTraceCategory has the following properties:

Property
Type
Description

Property

Type

Description

TC_SDK

Enum String

For SDK level events e.g. after has successfully initialized

TC_ENROLLMENT

Enum String

For events related to the enrolment flow

TC_LOOKUP

Enum String

For events related to the lookup flow

TC_FACE_SESSION

Enum String

For events related to the face session flow

UQTraceEvent has following properties:

Property
Type
Description

TE_INIT

Enum String

Event when SDK initializes

TE_VIEW

Enum String

Event when a screen is presented to the user. Can be used to track the screen sessions.

TE_START

Enum String

Event when a certain process starts, e.g. scanning of a document starts

TE_IN_PROGRESS

Enum String

Event during document scanning and facial recognition

TE_COMPLETE

Enum String

Event when any process completes, e.g. scanning of a document completes

TE_SKIP

Enum String

Event when a specific step is skipped, e.g. NFC

TE_FINISH

Enum String

Event when the the overall flow is terminated

UQTraceStatus has the following parameters:

Property
Type
Description

TS_SUCCESS

Enum String

Status when an event is successful

TS_FAILURE

Enum String

Status when an event is not successful

UQTracePage has following properties:

Property
Type
Description

TP_SCAN

Enum String

Document scanning page

TP_LOOKUP

Enum String

Lookup page

TP_READ

Enum String

NFC chip reading page

TP_FACE

Enum String

Facial recognition page

TP_BACKGROUND_CHECK

Enum String

Background check page

UQTraceStatusCode has the following properties:

Note: Please be aware that all codes with event IN_PROGRESS, except for SCAN_DOCUMENT_FRONT_PROCESSED and SCAN_DOCUMENT_BACK_PROCESSED, are throttled (limited to one identical event every 5 seconds). This is to ensure that your client is not overwhelmed and to accommodate varying speeds of different phones, which may send different numbers of events.

Property
Type
Description

TSC_USER_CANCEL

Enum String

Status defined when user cancels the flow, or user declines the background check or users stops the chip reading process (only iOS)

TSC_SESSION_EXPIRED

Enum String

Flow terminates because the session expires, e.g. auth token not valid anymore

TSC_UNEXPECTED_ERROR

Enum String

Flow terminates because of an unexpected error

TSC_SCAN_DOCUMENT_FRONT_BACK_MISMATCH

Enum String

When scanning fails because the front and back of the document don’t match, e.g. emirates id number in the front doesn’t match the id in the MRZ in the back page.

TSC_SCAN_DOCUMENT_NOT_RECOGNIZED

Enum String

When scanning fails because either the wrong document type is selected or not able to read data due to lighting conditions.

TSC_SCAN_DOCUMENT_EXPIRED

Enum String

When scanning an expired document

TSC_SCAN_DOCUMENT_FRONT_PROCESSED

Enum String

Front of the document was successfully scanned

TSC_SCAN_DOCUMENT_BACK_PROCESSED

Enum String

Back of the document was successfully scanned

TSC_SCAN_DOCUMENT_DARK_ENVIRONMENT_DETECTED

Enum String

Dark environment detected

TSC_SCAN_DOCUMENT_INCORRECT_DISTANCE_DETECTED

Enum String

Incorrect distance detected between the camera and the document

TSC_SCAN_DOCUMENT_BLUR_DETECTED

Enum String

Blur or noisy image detected

TSC_SCAN_DOCUMENT_INCORRECT_TYPE_DETECTED

Enum String

Incorrect document type dected, e.g. presenting another document type

TSC_SCAN_DOCUMENT_INCORRECT_SIDE_DETECTED

Enum String

Incorrect document side dected, e.g. presenting the back of the document instead of the front side

TSC_SCAN_DOCUMENT_GLARE_DETECTED

Enum String

Reflections detected on the document

TSC_SCAN_DOCUMENT_ID_PHOTO_BAD_QUALITY_DETECTED

Enum String

ID photo on the document is not clear

TSC_SCAN_DOCUMENT_SCREEN_DETECTED

Enum String

Screen detected (Available only if not disabled with the option allowNonPhysicalDocuments=True)

TSC_SCAN_DOCUMENT_PRINT_DETECTED

Enum String

Print detected (Available only if not disabled with the option allowNonPhysicalDocuments=True)

TSC_SCAN_DOCUMENT_ID_PHOTO_TAMPERING_DETECTED

Enum String

ID photo tampering detected (Available only if not disabled with the option disableTamperingRejection=True)

TSC_READ_DOCUMENT_DISCONNECTED

Enum String

When the document is removed from the device when chip reading is in progress.

TSC_READ_AUTHENTICATION_FAILED

Enum String

When the chip authentication fails because of the OCR data in scanning step weren’t correct

TSC_READ_NFC_UNAVAILABLE

Enum String

When reading is enabled but not forced and the device doesn’t support NFC. The step gets skipped, event SKIP

TSC_READ_NFC_DOCUMENT_NOT_SUPPORTED

Enum String

When reading is enabled and forceReadingIfSupported is enabled and the document does not support NFC. The step gets skipped, event SKIP

TSC_FACE_LIVENESS_FAILED

Enum String

When liveness detection fails during facial recognition

TSC_FACE_NO_MATCH

Enum String

When face doesn’t match the picture provided with the document, or from the chip if available, during facial recognition

TSC_FACE_TIMEOUT

Enum String

When not user face or no face motion is detected during the facial recognition process

TSC_FACE_INCORRECT_POSITION_DETECTED

Enum String

Incorrect face position detected

TSC_FACE_INCORRECT_DISTANCE_DETECTED

Enum String

Incorrect face distance detected

TSC_FACE_DARK_ENVIRONMENT_DETECTED

Enum String

Dark environment detected

TSC_FACE_BLUR_DETECTED

Enum String

Blur or noisy image detected

TSC_FACE_MOUTH_COVER_DETECTED

Enum String

Mouth covered detected

TSC_FACE_EYES_COVER_DETECTED

Enum String

Eyes covered detected

TSC_FACE_EYES_CLOSED_DETECTED

Enum String

Eyes closed detected (Available only if not disabled with the option allowClosedEyes=True)

TSC_FACE_SPOTLIGHT_DETECTED

Enum String

Bright spotlight on the face detected

TSC_FACE_SHADOW_DETECTED

Enum String

Shadow on the face detected

TSC_FACE_EYES_SHADOW_DETECTED

Enum String

Shadow on the eyes detected

TSC_READ_DOCUMENT_VALIDATION_FAILED

Enum String

Session gets invalidated because the CHIP validation of the card fails, and the reading step is forced by configuration

TSC_READ_CHIP_VALIDATION_FAILED

Enum String

Session gets invalidated because the document doesn’t support reading (e.g. no chip available) and the reading step is forced by configuration

TSC_FACE_RECOGNITION_TOO_MANY_ATTEMPTS

Enum String

Session gets invalidated because of too many failed facial recognition attempts

TSC_LOOKUP_INVALID_INPUT

Enum String

ID not found based on the information provided by the end user

TSC_LOOKUP_ID_NOT_FOUND

Enum String

ID not found based or wrong information provided by the end user

TSC_LOOKUP_OTP_TOO_MANY_ATTEMPTS

Enum String

Session gets invalidated because of too many failed OTP attempts

TSC_CAMERA_NOT_AVAILABLE

Enum String

Session gets invalidated because the camera is not available

TSC_CAMERA_PERMISSION_NOT_GRANTED

Enum String

Session gets invalidated because camera the end user denies camera access

SCAN_DOCUMENT_INCORRECT_POSITION_DETECTED

Enum String

Incorrect position detected, e.g. document positioned too on the top or the bottom of the screen

SCAN_DOCUMENT_FINGER_DETECTED

Enum String

Fingers are obstructing the document

FACE_MULTIPLE_FACES_DETECTED

Enum String

Multiple faces detected during facial recognition

To enable the tracing mechanism, pass your implementation to the init method like the example below. Even in a Swift project you have to write the implementation in Objective-C. You can then decide to follow up with Swift passing the trace data from objective c to Swift.

Tracer implementation example:

Objective-C
@implementation UQTracer

- (void)trace:(UQTrace *)trace {
    NSString *documentTypeName = @"";
    if (trace.documentType != UNSPECIFY) {
        UQDocumentConfig *document = [[UQDocumentConfig alloc] initWithDocumentType:trace.documentType];
        documentTypeName = document.documentName;
    }
    NSString *timeStamp = [self timeStamp:trace.timestamp];
    NSLog(@"Trace(sessionId=%@, category=%@, event=%@, page=%@, status=%@, statusCode=%@, statusMessage=%@, documentType=%@, timestamp=%@)" , trace.sessionId, trace.category->name, trace.event->name, trace.page->name ,trace.status->name, trace.statusCode->name, trace.statusMessage, documentTypeName, timeStamp);
}

- (NSString *)timeStamp:(NSDate *)currentDate {
    return [NSDateFormatter localizedStringFromDate:currentDate
                                            dateStyle:NSDateFormatterFullStyle
                                            timeStyle:NSDateFormatterFullStyle];
}
@end

Tracer implementation example passing the trace data to Swift (the example below assumes that you have the SwiftTracer object defined in your Swift project with method signature trace):

Objective-C
@interface UQTracer ()
@property (nonatomic) SwiftTracer *swiftTracer;
@end

@implementation UQTracer
- (instancetype)init {
    self = [super init];
    if (self) {
        self.swiftTracer = [[SwiftTracer alloc] init];
    }
    return self;
}

- (void)trace:(UQTrace *)trace {
    NSString *documentTypeName = @"";
    if (trace.documentType != UNSPECIFY) {
        UQDocumentConfig *document = [[UQDocumentConfig alloc] initWithDocumentType:trace.documentType];
        documentTypeName = document.documentName;
    }

    [self.swiftTracer     traceWithSessionId:trace.sessionId
                                    category:trace.category->name
                                       event:trace.event->name
                                      status:trace.status->name
                                        page:trace.page->name
                                  statusCode:trace.statusCode->name
                               statusMessage:trace.statusMessage
                                    document:documentTypeName
                                   timestamp:trace.timestamp];
}
@end

Initialize SDK with tracer in Objective-C:

Objective-c
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey,id> *)launchOptions {
    UQTracer *tracer = [[UQTracer alloc] init];
    [[UQBuilderController alloc] initWithTracer:tracer];
    return YES;
}
@end

Initialize SDK with tracer in Swift:

Swift
class AppDelegate: UIResponder, UIApplicationDelegate {
        
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let tracer = UQTracer()
        _ = UQBuilderController.init(tracer: tracer)
        return true
    }
}

Below you can find an example of the tracing above for a full enrollment flow with some errors in between to showcase the events:

2021-02-04 23:55:52.835375+0700 UqudoSDKDemo[520:87001] Trace(sessionId=(null), category=SDK, event=INIT, page=(null), status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:55:52 Indochina Time)
2021-02-04 23:56:30.331468+0700 UqudoSDKDemo[520:87090] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=VIEW, page=SCAN, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:56:30 Indochina Time)
2021-02-04 23:56:31.270246+0700 UqudoSDKDemo[520:87090] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=SCAN, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:56:31 Indochina Time)
2021-02-04 23:56:43.938264+0700 UqudoSDKDemo[520:87259] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=SCAN, status=FAILURE, statusCode=SCAN_DOCUMENT_NOT_RECOGNIZED, statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:56:43 Indochina Time)
2021-02-04 23:56:52.071336+0700 UqudoSDKDemo[520:87279] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=SCAN, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:56:52 Indochina Time)
2021-02-04 23:57:05.886765+0700 UqudoSDKDemo[520:87280] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=SCAN, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:57:05 Indochina Time)
2021-02-04 23:57:05.903494+0700 UqudoSDKDemo[520:87280] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=VIEW, page=READ, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:57:05 Indochina Time)
2021-02-04 23:57:10.125406+0700 UqudoSDKDemo[520:87280] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=READ, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:57:10 Indochina Time)
2021-02-04 23:57:25.038866+0700 UqudoSDKDemo[520:87259] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=READ, status=FAILURE, statusCode=READ_DOCUMENT_DISCONNECTED, statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:57:25 Indochina Time)
2021-02-04 23:57:35.027795+0700 UqudoSDKDemo[520:87259] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=READ, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:57:35 Indochina Time)
2021-02-04 23:57:39.185936+0700 UqudoSDKDemo[520:87399] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=READ, status=FAILURE, statusCode=USER_CANCEL, statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:57:39 Indochina Time)
2021-02-04 23:57:42.994229+0700 UqudoSDKDemo[520:87401] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=READ, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:57:42 Indochina Time)
2021-02-04 23:58:09.691329+0700 UqudoSDKDemo[520:87752] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=READ, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=PASSPORT, timestamp=Thursday, 4 February BE 2564 23:58:09 Indochina Time)
2021-02-04 23:58:09.695761+0700 UqudoSDKDemo[520:87752] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=VIEW, page=FACE, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:09 Indochina Time)
2021-02-04 23:58:11.906030+0700 UqudoSDKDemo[520:87792] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=FACE, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:11 Indochina Time)
2021-02-04 23:58:20.427607+0700 UqudoSDKDemo[520:87752] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=FACE, status=FAILURE, statusCode=FACE_TIMEOUT, statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:20 Indochina Time)
2021-02-04 23:58:23.958376+0700 UqudoSDKDemo[520:87913] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=FACE, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:23 Indochina Time)
2021-02-04 23:58:32.470057+0700 UqudoSDKDemo[520:87802] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=FACE, status=FAILURE, statusCode=FACE_TIMEOUT, statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:32 Indochina Time)
2021-02-04 23:58:34.140175+0700 UqudoSDKDemo[520:87913] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=FACE, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:34 Indochina Time)
2021-02-04 23:58:50.816411+0700 UqudoSDKDemo[520:87924] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=FACE, status=FAILURE, statusCode=FACE_TIMEOUT, statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:50 Indochina Time)
2021-02-04 23:58:51.657288+0700 UqudoSDKDemo[520:87912] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=FACE, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:51 Indochina Time)
2021-02-04 23:58:58.925882+0700 UqudoSDKDemo[520:87924] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=FACE, status=FAILURE, statusCode=FACE_NO_MATCH, statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:58:58 Indochina Time)
2021-02-04 23:59:05.496069+0700 UqudoSDKDemo[520:87913] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=FACE, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:59:05 Indochina Time)
2021-02-04 23:59:17.045578+0700 UqudoSDKDemo[520:87913] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=FACE, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:59:17 Indochina Time)
2021-02-04 23:59:17.137647+0700 UqudoSDKDemo[520:88083] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=VIEW, page=BACKGROUND_CHECK, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:59:17 Indochina Time)
2021-02-04 23:59:19.777937+0700 UqudoSDKDemo[520:87924] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=START, page=BACKGROUND_CHECK, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:59:19 Indochina Time)
2021-02-04 23:59:21.272898+0700 UqudoSDKDemo[520:88037] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=COMPLETE, page=BACKGROUND_CHECK, status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:59:21 Indochina Time)
2021-02-04 23:59:22.857039+0700 UqudoSDKDemo[520:87913] Trace(sessionId=9C40E0C2-A7C2-4FF2-B0C1-C22DE3E99D18, category=ENROLLMENT, event=FINISH, page=(null), status=SUCCESS, statusCode=(null), statusMessage=(null), documentType=, timestamp=Thursday, 4 February BE 2564 23:59:22 Indochina Time)

Below you can find an example on how to use the trace information with Firebase Analytics:

Objective-C
#import <Foundation/Foundation.h>
#import <UqudoSDK/UqudoSDK.h>
@import FirebaseAnalytics;

@implementation UQTracer

- (void)trace:(UQTrace *)trace {
    NSString *timeStamp = [self timeStamp:trace.timestamp];
    NSMutableDictionary* parameters = [[NSMutableDictionary alloc] init];
    [parameters setValue:trace.event->name forKey:@"event"];
    [parameters setValue:trace.status->name forKey:@"status"];
    [parameters setValue:timeStamp forKey:@"timestamp"];
    if (trace.sessionId) {
        [parameters setValue:trace.sessionId forKey:@"sessionId"];
    }
    if (TP_NULL != trace.page) {
        [parameters setValue:trace.page->name forKey:@"page"];
    }
    if (TSC_NULL != trace.statusCode) {
        [parameters setValue:trace.statusCode->name forKey:@"statusCode"];
    }
    if (trace.documentType != UNSPECIFY) {
        UQDocumentConfig *document = [[UQDocumentConfig alloc] initWithDocumentType:trace.documentType];
        [parameters setValue:document.documentName forKey:@"documentType"];
    }
    if (trace.statusMessage) {
        [parameters setValue:trace.statusMessage forKey:@"statusMessage"];
    }
    [FIRAnalytics logEventWithName:trace.category->name parameters:parameters];
}

- (NSString *)timeStamp:(NSDate *)currentDate {
    NSISO8601DateFormatter *dateFormatter = [[NSISO8601DateFormatter alloc] init];
    return [dateFormatter stringFromDate:currentDate];
}

@end
PreviousText & LanguageNextWeb

Last updated 19 days ago

Was this helpful?