Initialise the SDK
The SDK requires to initialise only once when your application starts, we recommend doing this step in AppDelegate
Objective-C
Add the following in your AppDelegate.m:
Copy #import <UqudoSDK/UqudoSDK.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UQBuilderController alloc] init];
return YES;
}
Swift
Add the Bridging Header to your project. When adding your .m file, you’ll receive a prompt with Yes, No and Cancel buttons. Hit Yes.
If you don’t see the prompt, or accidentally deleted your bridging header, add a new .h file to your project and name it <#YourProjectName#>-Bridging-Header.h.
Add the following import to your Bridging-Header.h:
Copy #import < UqudoSDK / UqudoSDK.h >
In the AppDelegate.swift, initialize the SDK:
Copy func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UQBuilderController ()
return true
}
Implement Interface
Extend UQBuilderControllerDeleate in your controller where you initiate the SDK.
Objective-C
Import Uqudo SDK header and conform to UQBuilderControllerDeleate:
Copy #import <UqudoSDK/UqudoSDK.h>
@interface YourViewController ()<UQBuilderControllerDelegate>
Implement the delegate methods:
Copy - (void)didEnrollmentCompleteWithInfo:(NSString *)info;
- (void)didEnrollmentIncompleteWithStatus:(UQSessionStatus *)status;
- (void)didFaceSessionCompleteWithInfo:(nonnull NSString *)info;
- (void)didFaceSessionIncompleteWithStatus:(UQSessionStatus *)status;
- (void)didLookupFlowCompleteWithInfo:(NSString *)info;
- (void)didLookupFlowIncompleteWithStatus:(UQSessionStatus *)status;
Swift
Conform to UQBuilderControllerDeleate:
Copy class ViewController : UIViewController , UQBuilderControllerDelegate
Implement the delegate methods:
Copy func didEnrollmentComplete ( withInfo info : String ) {}
func didEnrollmentIncomplete ( with status : UQSessionStatus) {}
func didFaceSessionComplete ( withInfo info : String ) {}
func didFaceSessionIncomplete ( with status : UQSessionStatus) {}
func didLookupFlowComplete ( withInfo info : String ) {}
func didLookupFlowIncomplete ( with status : UQSessionStatus) {}