Skip to main content

Get started iOS

1. Prerequisites

To utilise the Weavr iOS SDK for Swift, you need:

  1. Apple Developer tools
  2. Active UI Key from the Embedder Portal
  3. Weavr iOS SDK for Swift

Compatibility

VersionRelease dateMin iOS version
3.0June 202515.1+
1.6May 202513+

Apple Developer tools

Install XCode

You can install Apple’s developer tool XCode from the Mac App Store. For more information, visit resources on Apple’s developer portal.

  • The SDK requires Swift toolchain 5.9 or later.
  • MacOS Xcode, minimum of Xcode 14, but we recommend being at least on Xcode 16.
  • iOS version to 15.1 or later
  • Enable push notification on the device
  • Biometric authentication on the device
$ swift --version
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) Target: x86_64-apple-macosx14.0

After installing Xcode, you are now ready to start your own Xcode project or run the Sample app.

2. Installation

You can install the Weavr iOS SDK via CocoaPods or Manually. Swift Package Manager support is going to be available in future versions.

Swift Package Manager

To install the Weavr Secure Components iOS SDK using Swift Package Manager (SPM):

  1. Open your Xcode project.
  2. Navigate to File > Add Packages...
  3. In the search bar, enter the following URL:
    https://github.com/weavr-io/secure-components-ios.git
  4. Select the version you wish to use. Weavr adheres to Semantic versioning and so recommend using the Up to next major version dependency rule.
  5. Click Add Package to integrate the SDK into your project, and select the target where you want to add the SDK.

CocoaPods

CocoaPods is a dependency management service for Objective-C and Swift Projects. For more information about installation and usage, visit dependency manager CocoaPods. To integrate Weavr iOS SDK into your Xcode project, specify in your Podfile.

Podfile
source 'https://cdn.cocoapods.org/'
source 'https://github.com/SumSubstance/Specs.git'

use_frameworks! : linkage => :dynamic # Required by Approov

pod 'ApproovURLSession', '~> 3.3.3' # Approov for secure mobile API protection
pod 'WeavrComponents', '1.6.4' # Weavr SDK for biometric authentication and UI components
pod 'IdensicMobileSDK', '1.31.0' # Sumsub SDK for identity verification
pod 'Firebase/Analytics' # Firebase analytics
pod 'Firebase/Core' # Core Firebase functionality
pod 'Firebase/Messaging' # Firebase Cloud Messaging for push notifications
pod 'FirebaseAppCheck' # Firebase App Check for device integrity verification

The minimum supported iOS deployment target is iOS 15.1 —- ensure your Podfile includes platform :ios, '15.1' or higher.

If you have any issues with pod:

  1. Check and update your pod version.
  2. Add the following pod hook in your podfile:
Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end

Manual install

It's more convenient if you download the WeavrComponents.xcframework from Weavr repository and drag into your Xcode project workspace or project.

iOS Manual install

3. Permissions

You must add the following usage descriptions in your Info.plist:

  • NSPhotoLibraryUsageDescription - Required so the user can select a picture of themselves or their identification documents (e.g. passport) from their photo library.
  • NSCameraUsageDescription - Required so the user can take a picture of themselves or their identification documents (e.g. passport).
  • NSMicrophoneUsageDescription - Required during the KYC flow.
  • NSLocationWhenInUseUsageDescription - To validate the location the user is in while performing the KYC flow.
  • NSFaceIDUsageDescription - Required so the user can login with biometrics.

4. Set AppCheck token

To securely link Firebase App Check protection with Weavr’s SDK components, you must retrieve and store the App Check token before sensitive operations like login or biometric enrolment.

The UXComponents.setAppCheckToken(_:) method securely injects the App Check token into the SDK.

UXComponents.setAppCheckToken(token)

The method UXComponents.setAppCheckToken(_:) returns a Bool.

true: the token was stored successfully in the SDK.

false: the firebase App Check token was not accepted —- ensure the token is valid and properly formatted.

5. Initialize the SDK

After the libraries are in place, you can use the Swift import directive to import the individual libraries into each source file that needs them.

Import the libraries wherever you use the components like

import WeavrComponents

And, initialize the Weavr component SDK by,

UXComponents.initialize(env: ENV.SANDBOX, uiKey: "Your UI Key")