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

iOSAndroidWeb
Interface languageSwiftKotlinTypeScript
Inquiry UI toolkitSwiftUI (from UIKit, host FolioInquiry in a UIHostingController)Jetpack ComposeReact
PackagesSwift package FolioSDK: products FolioSDK, FolioInquiryUI and FolioSDKBinaryid.folio:sdk, which pulls in id.folio:sdk-native@folio/sdk
Selfie engine packageA package dependency of FolioInquiryUIA dependency of id.folio:sdkA dependency of @folio/sdk
How the core shipsStatic library in the binary framework FolioSDK.xcframeworkNative library for arm64-v8a, armeabi-v7a and x86_64WebAssembly module with a manifest
Runtime providerThe SwiftUI view FolioSDKProvider(runtime:content:)The composable FolioSDKProvider(runtime) { ... }The React component FolioSDKProvider from @folio/sdk/provider
Store helpersEvery store is an ObservableObjectrememberVaultStore() and one composable per storeuseVaultStore() and one hook per store, from @folio/sdk/stores
Setup guideiOS setupAndroid setupWeb setup

Minimum versions

PlatformRequirement
iOSiOS 15 or later. Xcode 15 or later; the package manifests use Swift tools version 5.9. Swift Package Manager.
AndroidminSdk 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.
Webreact 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

CapabilityiOSAndroidWebPage
Document photo with the cameraYes. 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 fileYes, when the inquiry allows itYes, when the inquiry allows itYes, when the inquiry allows itInquiry store
NFC chip readingYes, with Core NFCYes, on devices with an NFC reader that is switched onNo. MrtdStore exists, but every read fails with ChipNotSupported.NFC chip reading
Selfie with livenessYes, with DefaultSelfieCaptureProvider or the provider you passYes, with DefaultSelfieCaptureProvider or the provider you passYes, built into the inquiry UISelfie capture
Email and phone one-time codesYesYesYesInquiry store
Handoff to another deviceYesYesYesInquiry store
Embed loader for pages without the SDKNoNoYesInquiry 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.

On this page