Documentation Index
Fetch the complete documentation index at: https://documentation.idenfy.com/llms.txt
Use this file to discover all available pages before exploring further.
Logging
The SDK provides a way to log user and SDK common actions (lifecycle events, navigation, camera changes). This can be useful for understanding specific scenarios or troubleshooting potential issues.
To enable logging, provide your implementation of the IdenfyLoggingHandlerUseCase class:
let consoleLogging = ConsoleLoggingImpl()
idenfyController.setIdenfyLoggingHandler(idenfyLoggingHandler: IdenfyLoggingHandlerUseCaseImpl(consoleLogging))
class ConsoleLoggingImpl {
func log(event: String, message: String, token _: String) {
print("SDKLog", event, " - ", message)
}
}
import iDenfySDK
class IdenfyLoggingHandlerUseCaseImpl: IdenfyLoggingHandlerUseCase {
private var consoleLogging: ConsoleLoggingImpl!
init(_ consoleLogging: ConsoleLoggingImpl) {
self.consoleLogging = consoleLogging
}
func logEvent(event: String, message: String, token: String) {
#if DEBUG
consoleLogging.log(event: event, message: message, token: token)
#endif
}
}
User Events Webhooks
The SDK provides webhooks about events occurring throughout the verification process. Results are delivered while the verification process is active and the application is presenting SDK views.
Declare a Class for Receiving Events
Declare a class that implements IdenfyUserFlowHandler to call your backend service, log events, or apply changes:
import iDenfySDK
@objc public class IdenfyUserFlowCallbacksHandler: NSObject, IdenfyUserFlowHandler {
public func onPhotoUploaded(photo: String, step: String) {
print("IdenfyUserFlowHandler - onPhotoUploaded \(step)")
}
public func onDocumentSelected(documentType: String) {
print("IdenfyUserFlowHandler - onDocumentSelected \(documentType)")
}
public func onCountrySelected(issuingCountryCode: String) {
print("IdenfyUserFlowHandler - onCountrySelected \(issuingCountryCode)")
}
public func onProcessingStarted(processingStarted: Bool) {
print("IdenfyUserFlowHandler - onProcessingStarted \(processingStarted)")
}
}
/// IdenfyUserFlowCallbacksHandler.h
#import <Foundation/Foundation.h>
#import <iDenfySDK/iDenfySDK-Swift.h>
@interface IdenfyUserFlowCallbacksHandler: NSObject <IdenfyUserFlowHandler>
@end
/// IdenfyUserFlowCallbacksHandler.m
#import "IdenfyUserFlowCallbacksHandler.h"
@implementation IdenfyUserFlowCallbacksHandler
- (void)onCountrySelectedWithIssuingCountryCode:(NSString * _Nonnull)issuingCountryCode {
NSLog(@"IdenfyUserFlowHandler - onCountrySelected %@", issuingCountryCode);
}
- (void)onDocumentSelectedWithDocumentType:(NSString * _Nonnull)documentType {
NSLog(@"IdenfyUserFlowHandler - onDocumentSelected %@", documentType);
}
- (void)onPhotoUploadedWithPhoto:(NSString * _Nonnull)photo step:(NSString * _Nonnull)step {
NSLog(@"IdenfyUserFlowHandler - onPhotoUploaded %@", step);
}
- (void)onProcessingStartedWithProcessingStarted:(BOOL)processingStarted {
NSLog(@"IdenfyUserFlowHandler - onProcessingStarted %id", processingStarted);
}
@end
Set the idenfyUserFlowCallbacksHandler
Set the idenfyUserFlowCallbacksHandler in the IdenfyController class:
...
idenfyController.setIdenfyUserFlowCallbacksHandler(idenfyUserFlowHandler: IdenfyUserFlowCallbacksHandler())
...
...
IdenfyUserFlowCallbacksHandler *idenfyUserFlowCallbackHandler = [[IdenfyUserFlowCallbacksHandler alloc] init];
[idenfyController setIdenfyUserFlowCallbacksHandlerWithIdenfyUserFlowHandler:idenfyUserFlowCallbackHandler];
...