Usage
Last updated
Was this helpful?
Last updated
Was this helpful?
The SDK requires to initialise only once when your application starts, we recommend doing this step in AppDelegate
Add the following in your AppDelegate.m:
#import <UqudoSDK/UqudoSDK.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UQBuilderController alloc] init];
return YES;
}
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:
#import <UqudoSDK/UqudoSDK.h>
In the AppDelegate.swift, initialize the SDK:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UQBuilderController()
return true
}
Extend UQBuilderControllerDeleate in your controller where you initiate the SDK.
Import Uqudo SDK header and conform to UQBuilderControllerDeleate:
#import <UqudoSDK/UqudoSDK.h>
@interface YourViewController ()<UQBuilderControllerDelegate>
Implement the delegate methods:
- (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;
Conform to UQBuilderControllerDeleate:
class ViewController: UIViewController, UQBuilderControllerDelegate
Implement the delegate methods:
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) {}