iOS installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Nevis Mobile Authentication SDK into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
...
pod 'NevisMobileAuthentication', '~> 3.7.0', :configurations => ['Release']
pod 'NevisMobileAuthentication-Debug', '~> 3.7.0', :configurations => ['Debug']
Then execute pod install with update.
pod install --repo-update
Swift Package Manager
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.
If you have your Swift package set up, adding Nevis Mobile Authentication SDK as a dependency is as easy as adding it to the dependencies value of your Package.swift:
dependencies: [
.package(url: "https://github.com/nevissecurity/nevis-mobile-authentication-sdk-ios-package.git", .upToNextMajor(from: "3.7.0"))
]
Or you can follow Apple's instructions about adding package dependencies to your app.
Currently only the release
flavor is released as SPM package.
Manual XCFramework integration
In case the SDK is provided as compressed archives, after unpacking, you see the following structure:
├── NevisMobileAuthentication
│ ├── LICENSE
│ ├── NevisMobileAuthentication.podspec
│ └── NevisMobileAuthentication.xcframework
│── NevisMobileAuthentication-Debug
│ ├── LICENSE
│ ├── NevisMobileAuthentication-Debug.podspec
│ └── NevisMobileAuthentication.xcframework
├── NevisMobileAuthentication-<version>-Docs.zip
└── README.MD
- The
NevisMobileAuthentication
folder contains an XCFramework built withrelease
flavor and the corresponding Podspec file. - The
NevisMobileAuthentication-Debug
folder contains an XCFramework built withdebug
flavor and the corresponding Podspec file. - The
NevisMobileAuthentication-<version>-Docs.zip
archive contains the API documentation.
As a first step move or copy both folders to your project files:
├── Frameworks
│ ├── NevisMobileAuthentication
│ │ └── ...
│ └── NevisMobileAuthentication-Debug
│ └── ...
│── Podfile
│── Sample
└── Sample.xcodeproj
CocoaPods
To integrate the Nevis Mobile Authentication SDK using Cocoapods with local references, do the following:
- Create or edit your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
...
pod 'NevisMobileAuthentication', :path => 'Frameworks/NevisMobileAuthentication', :configurations => ['Release']
pod 'NevisMobileAuthentication-Debug', :path => 'Frameworks/NevisMobileAuthentication-debug', :configurations => ['Debug']
- Execute pod install:
pod install
- Open the generated Xcode workspace.
Xcode
To integrate the Nevis Mobile Authentication SDK using Xcode, do the following:
- Open your application Xcode project or workspace.
- Drag and drop one of the frameworks into your project.
- Make sure the framework is listed under General > Linked Frameworks and Libraries.
Xcode does not support configuration based linkage out of the box. Only one framework can be linked at a time.
General notes
Although the primary language of the SDK is Swift, it also contains an Objective-C bridging header, so it can also be used for purely Objective-C projects after the appropriate import:
#import <NevisMobileAuthentication/NevisMobileAuthentication.h>
Set ENABLE_BITCODE
to No
as the SDK does not contain bitcode.
Add a description to the NSFaceIDUsageDescription
key in the Info.plist
file of your application. Ideally, the NSFaceIDUsageDescription
key value is not localized.
<key>NSFaceIDUsageDescription</key>
<string>Enabling Face ID allows you to use the Face Recognition authenticator.</string>