Platforms
The platforms the Folio SDK supports, their packages and minimum versions, and which verification capabilities each platform has.
Preview
This page describes a pre-release version of the SDK. Names, versions and APIs on this page can change before the release.
The Folio SDK has a package for iOS, Android and the web. Every package runs the same SDK core, so the runtime, the stores, their actions and their state behave the same way on every platform. What differs is the language of the interface, the UI toolkit of the ready-made inquiry UI and the device features a platform offers.
Overview
| iOS | Android | Web | |
|---|---|---|---|
| Interface language | Swift | Kotlin | TypeScript |
| Inquiry UI toolkit | SwiftUI (from UIKit, host FolioInquiry in a UIHostingController) | Jetpack Compose | React |
| Packages | Swift package FolioSDK: products FolioSDK, FolioInquiryUI and FolioSDKBinary | id.folio:sdk, which pulls in id.folio:sdk-native | @folio/sdk |
| Selfie engine package | A package dependency of FolioInquiryUI | A dependency of id.folio:sdk | A dependency of @folio/sdk |
| How the core ships | Static library in the binary framework FolioSDK.xcframework | Native library for arm64-v8a, armeabi-v7a and x86_64 | WebAssembly module with a manifest |
| Runtime provider | The SwiftUI view FolioSDKProvider(runtime:content:) | The composable FolioSDKProvider(runtime) { ... } | The React component FolioSDKProvider from @folio/sdk/provider |
| Store helpers | Every store is an ObservableObject | rememberVaultStore() and one composable per store | useVaultStore() and one hook per store, from @folio/sdk/stores |
| Setup guide | iOS setup | Android setup | Web setup |
Minimum versions
| Platform | Requirement |
|---|---|
| iOS | iOS 15 or later. Xcode 15 or later; the package manifests use Swift tools version 5.9. Swift Package Manager. |
| Android | minSdk 23 or later. The SDK is compiled against API level 34. Java source and target compatibility 17, Kotlin jvmTarget 17. Jetpack Compose for the inquiry UI and rememberFolioSdk. |
| Web | react and react-dom in a version that matches ^18.0.0 || ^19.0.0. A browser with WebAssembly support. A bundler that serves ES modules. |
The package versions of this preview are listed on Versions and build info.
Capabilities
| Capability | iOS | Android | Web | Page |
|---|---|---|---|---|
| Document photo with the camera | Yes. The camera takes the photo when the SDK decides the document is in place; a shutter button appears after five seconds. | Yes. The person takes the photo with the shutter button. | Yes. The camera takes the photo when the SDK decides the document is in place; a capture button appears after five seconds. | Inquiry store |
| Document upload from a file | Yes, when the inquiry allows it | Yes, when the inquiry allows it | Yes, when the inquiry allows it | Inquiry store |
| NFC chip reading | Yes, with Core NFC | Yes, on devices with an NFC reader that is switched on | No. MrtdStore exists, but every read fails with ChipNotSupported. | NFC chip reading |
| Selfie with liveness | Yes, with DefaultSelfieCaptureProvider or the provider you pass | Yes, with DefaultSelfieCaptureProvider or the provider you pass | Yes, built into the inquiry UI | Selfie capture |
| Email and phone one-time codes | Yes | Yes | Yes | Inquiry store |
| Handoff to another device | Yes | Yes | Yes | Inquiry store |
| Embed loader for pages without the SDK | No | No | Yes | Inquiry embed |
The selfie step needs its engine on iOS and Android. On both, InquiryPlatform uses
DefaultSelfieCaptureProvider unless you pass your own provider. On iOS the provider can also be
nil, and without one the selfie step stays on its processing screen and never completes. When a
liveness run fails, iOS and Android go back one step, and the web shows a dialog with a retry
button. On the web the engine comes with @folio/sdk, so there is nothing to install for it.
iOS
The iOS package is a Swift package with three library products. Add FolioSDK, FolioSDKBinary
and FolioInquiryUI to your app target: FolioSDK holds the Swift interface, FolioSDKBinary the
native library behind it, and FolioInquiryUI the ready-made inquiry UI. FolioInquiryUI depends
on Lottie (lottie-spm, from 4.6.1), which Swift Package Manager resolves for you.
The package resolves the capture engine of the selfie step as a transitive package dependency and
links FolioInquiryUI to it, so DefaultSelfieCaptureProvider needs no product of its own.
The chip reading step uses a Core NFC tag reader session. On a device where NFC reading is not available, the SDK reports NFC as not available. See iOS setup for the device features the inquiry UI uses.
FolioSDKProvider(runtime:content:) puts the runtime into the SwiftUI environment; a view below it
reads the FolioSdk with @EnvironmentObject. The inquiry UI opens links, including the redirect
at the end of an inquiry, with UIApplication.shared.open, so iOS handles a universal link: an app
that claims the URL opens, otherwise the browser does.
Android
id.folio:sdk holds the Kotlin interface in id.folio.sdk, the inquiry UI in
id.folio.sdk.inquiry, the platform layer XPlatform in id.folio.sdk.platform and
DefaultSelfieCaptureProvider in id.folio.sdk.inquiry.ui.verification.selfie.
id.folio:sdk-native holds the native library. id.folio:sdk depends on id.folio:sdk-native and
on the capture engine of the selfie step, which the Folio Maven repository serves, so an app adds
id.folio:sdk alone.
Call XPlatform.init once per process, from Application.onCreate, before you create a
runtime. The manifest of id.folio:sdk declares the permissions the SDK needs, including
android.permission.CAMERA and android.permission.NFC, and declares the camera and NFC hardware
features as not required, so your app installs on devices without them. See
Android setup.
In Compose, rememberFolioSdk(config, mapper) creates the runtime and keeps it across configuration
changes, and FolioSDKProvider(runtime) { ... } provides it to rememberSessionStore(),
rememberAuthStore(), rememberVaultStore(), rememberInquiryStore(), rememberMrtdStore(),
rememberLogsStore(init), rememberFolioDocumentListStore() and
rememberFolioDocumentStore(init). A provider for one host interface, such as
VaultHostProvider, serves the store composable of that host alone. The inquiry UI opens links,
including the redirect at the end of an inquiry, with an Intent.ACTION_VIEW intent, so Android
resolves them as any link: an app that handles the URL, such as your own app through Android App
Links, or otherwise the browser.
Web
@folio/sdk holds the SDK core as a WebAssembly module, the TypeScript interface, the browser
platform layer, the inquiry UI as React components, and the illustrations and chip reading
animations of the inquiry UI. Your page loads the module once with initializeFolioWasm before it
creates a runtime, and serves the illustrations and animations directories of the package at
the assetBaseUrl of the inquiry. baseUrl is Folio's backend origin, because the SDK signs each
request for that address. Your page registers it with registerPageProxiedApiOrigin, which sends
the SDK's requests to the same paths on your page's origin, and forwards /api and
/.well-known/jwks.json of its own origin to Folio. The SDK keeps its data in the storage of your
page's origin. See Web setup and Storage.
In React, FolioSDKProvider from @folio/sdk/provider provides the runtime, and the hooks
useSessionStore(), useAuthStore(), useVaultStore(), useInquiryStore(), useMrtdStore(),
useLogsStore(init), useFolioDocumentListStore() and useFolioDocumentStore(init) from
@folio/sdk/stores mount a store for the lifetime of a component. See
React provider and hooks. The inquiry UI navigates the page
to the redirect at the end of an inquiry in the same tab.
The embed loader runs the inquiry in an iframe served from Folio's origin, with its own copy of the
SDK. Your page loads one module script and calls window.FolioInquiry.mount; it needs no npm
package, bundler or React. See Inquiry embed.