Get Started iOS
To utilise the Weavr iOS SDK for Swift, you need the following,
- Apple Developer tools
- Active UI Key from the Embedder Portal
- 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):
- Open your Xcode project.
- Navigate to File > Add Packages...
- In the search bar, enter the following URL:
https://github.com/weavr-io/secure-components-ios.git
- Select the version you wish to use. Weavr adheres to Semantic versioning and so recommend using the
Up to next major version
dependency rule. - 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
.
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
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.
Swift Package Manager
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")