Skip to main content
Version: 3.1.x.x RR

Flutter plugin installation

Prerequisites

Your existing Flutter application project has to meet the following prerequisites:

  • iOS 12 or later
  • Xcode 14.x, including Swift 5.7 or later
  • Android 6 or later, with API level 23
  • Android 10 or later, with API level 29, for the biometric authenticator to work
  • Gradle 7.4 or later
  • Android Gradle Plugin com.android.tools.build:gradle 7.0.0 or later
  • Kotlin Gradle Plugin org.jetbrains.kotlin:kotlin-gradle-plugin 1.6.0 or later
  • Flutter SDK 3.0.x, stable channel

Pub

Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter and general Dart programs.

Integration with Flutter

To integrate Nevis Mobile Authentication SDK Flutter plugin into your Flutter project with Flutter execute this command:

flutter pub add nevis_mobile_authentication_sdk

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

pubspec.yaml
  dependencies:
nevis_mobile_authentication_sdk: ^3.1.0

Manual integration

Alternatively, you can edit your pubspec.yaml file manually:

pubspec.yaml
  dependencies:
flutter:
sdk: flutter

...
nevis_mobile_authentication_sdk: ^3.1.0

Then open a terminal and update the dependencies.

flutter pub get

Platform specific installation notes

Android

Gradle configuration

Add the following to your android/gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true
android.enableDexingArtifactTransform=false
shrink=false

Repository configuration

The Nevis Mobile Authentication Client SDK for Android is published as a GitHub package. You have to specify the repository in your android/build.gradle file:

build.gradle file using public Maven repository
allprojects {
repositories {
google ()
mavenCentral ()
maven {
url "https://maven.pkg.github.com/nevissecurity/nevis-mobile-authentication-sdk-android-package"
credentials {
username = <GITHUB_USERNAME>
password = <GITHUB_PERSONAL_ACCESS_TOKEN>
}
}
}
}
tip

Accessing GitHub packages requires you to have a GitHub account. You have to provide a Personal Access Token, as described here.

Dependency configuration

Declare Nevis Mobile Authentication Client SDK as a dependency in your android/app/build.gradle file:

Dependency for debug flavor
dependencies {
//noinspection GradleDynamicVersion
debugImplementation 'ch.nevis:nevis-mobile-authentication-sdk-android-debug:3.1.+'
}
info

The package repository only exposes the debug flavor. To use the release flavor contact us on [email protected].

iOS

Dependency configuration

To integrate Nevis Mobile Authentication Client SDK into your Flutter application using CocoaPods, specify it in your Podfile:

Podfile
  pod 'NevisMobileAuthentication', :configurations => ['Release']
pod 'NevisMobileAuthentication-Debug', :configurations => ['Debug']

Bitcode support

As the native iOS SDK does not provide Bitcode support, the following post install step needs to be added to the Podfile:

Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO' # NMA SDK does not support Bitcode
end
end
end

Then execute pod install with update.

pod install --repo-update

Enable Face Recognition

Modify your applications Info.plist file (located under ios/Runner) to add a description for the NSFaceIDUsageDescription key to use the Face Recognition authenticator. Ideally, this value should be localized.

Info.plist
<key>NSFaceIDUsageDescription</key>
<string>Enabling Face ID allows you to use the Face Recognition authenticator.</string>