Usage
MobbScan Gateway has been designed to be extremely easy to use. Here are the necessary steps:
Start the process
To start the process, you can either use GatewayView (SwiftUI) or GatewayViewController (UIKit) with the following parameters:
gatewayUrl: The URL of the MobbScan Gateway environment.onboardingToken: The token used to perform the operations.scanId: The ID used to identify a concrete operation.callback: A callback to handle when the process ends.
NOTE: If you have any questions about how to obtain the values for
gatewayUrl,onboardingToken, andscanId, please contact support.
// Start an async context, inside an `async` function or a `Task` for example
let gatewayView = await GatewayView(gatewayUrl: gatewayUrl, onboardingToken: onboardingToken, scanId: scanId, callback: callback)
// Present gatewayView as required for the app
GatewayViewController *gatewayViewController = [[GatewayViewController alloc] init];
gatewayViewController.gatewayUrl = gatewayUrl;
gatewayViewController.onboardingToken = onboardingToken;
gatewayViewController.scanId = scanId;
gatewayViewController.callback = callback;
// Present gatewayViewController as required for the app
Error Handling
If an error occurs and the process cannot be completed, the callback will be invoked with an MSCGError.
Finish the process
When the user finishes the process, the callback property will be invoked without an error to notify the app that the SDK process has finished and GatewayView / GatewayViewController can be dismissed.
Note:
GatewayView/GatewayViewControllerdoesn't dismiss itself. Aftercallbackis invoked, your app is responsible of dismissing the views and retrieving the results from the backend if needed.
