Configure the SDK (UIKit)
To configure the SDK using SDK key, we need to provide a SDK license key. Obtain your Passio key from the Passio developer portal.
To configure the SDK using Proxy URL, the SDK key is not required. The SDK will be on
remoteOnly
mode in that case. You need to provide following things when configuring the SDK using Proxy URL:Proxy URL - Base url of the target proxy endpoint
Proxy headers - Required headers to all of the requests
Create a new or open your existing project in Xcode and import the framework inside the View Controller
Define reference of SDK inside your View Controller
Configure the SDK using
PassioConfiguration
shown in below code. CallconfigurePassioSDK()
when you need to configure SDK e.g. insideviewDidLoad()
function.
The models required for the SDK to run local recognition can take some time for the first download. If the local recognition is not needed, setting the remoteOnly
to true on the PassioConfiguration process will skip the download of the models. Remote recognition functions like recognizeImageRemote
or searchForFood
will still work.
When the SDK is configured without SDK key (using Proxy URL), the SDK will be remoteOnly
.
Implement the
PassioStatusDelegate
protocol to receive configuration status updates. While the files are being downloaded, we can show in UI how many files are remanning for the download.
Update the UI based on the configuration status. The
isReadyForDetection
status indicated that the SDK is setup successfully and it is ready to use. The implementation ofself.askForCapturePermission()
method will be covered in the next section
Last updated