Skip to main content

Get Started iOS

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

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

1. Requirements

The Weavr iOS SDK helps you add Weavr UI Components and Biometric authentication to your iOS app.

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.
  • iOS version to 14.0 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'

pod 'WeavrComponents', '1.6.4' # Weavr SDK for biometric authentication and UI components
pod 'IdensicMobileSDK', '1.31.0' # Sumsub SDK for identity verification
pod 'ApproovURLSession', '~> 3.3.3' # Approov for secure mobile API protection
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 14.0 —- ensure your Podfile includes platform :ios, '14.0'. If you have any issues with pod, please check and update your pod version. If you still have issues with pod, please 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

Swift Package Manager

info

At present, the Weavr SDK cannot yet be integrated directly into iOS projects using SPM. Instead, developers need to rely on methods such as CocoaPods or manual integration.

3. 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.

4. 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")