Android
AAR artifact-based integration
To integrate the Device Binding SDK into your Android project via aar file
Link DeviceBindingSDK.aar from the OneSpan Mobile Security Suite package to the aars folder.
Link UtilitiesSDK.aar from the OneSpan Mobile Security Suite package to your project.
Note the following warnings when integrating the SDK:
To use the Device Binding SDK library, you also need to add the following external libraries to your maven/gradle project:
dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.2.21' implementation 'org.bouncycastle:bcprov-jdk18on:1.85.2' implementation 'androidx.datastore:datastore-preferences:1.1.1' }Prior to Android 10, you need to set the
READ_PHONE_STATEpermission in the AndroidManifest.xml file of your application if theSerialis used with thefingerprintmethodFor applications that target API 23 (or later) and run on Android 6.0 (or later), the
READ_PHONE_STATEpermission must be explicitly requested at runtime. See the Android sample in the OneSpan Mobile Security Suite package for more details.To prevent the backup of the data file the Device Binding SDK created, including a full system backup where all application data are saved via adb, you must edit the application manifest file and set the attribute
android:allowBackupto false.
Maven-based integration
The SDK artifact is also delivered as a local Maven repository with transitive dependencies, and the package includes a documentation jar file to view the technical documentation in Android Studio (to be used in conjunction with the Maven repository).
To integrate the SDK via maven repository
Copy the maven folder from the published artifacts to the root folder of your application.
Define the dependency in your build.gradle file:
implementation 'com.onespan:device_binding_android:+'.Comment out any existing definitions, for example:
implementation(name: 'DeviceBindingSDK', ext: 'aar'), implementation(name: 'UtilitiesSDK', ext: 'jar').
Threading
Some methods need to be called on a background thread. This applies to the following operations:
Call both
fingerprint()APIs off the main thread. These APIs perform Keystore operations and synchronously write data to DataStore.Biometric callbacks (
onAuthenticationSucceeded/onAuthenticationFailed) arrive on the main thread, because the prompt uses the main executor.Errors that are thrown before the prompt appears, such as salt validation or key generation errors, are thrown on the calling thread. On a background thread, you need to switch to the main thread before updating the user interface. The sample showcases this behavior.
iOS
To integrate the OneSpan Device Binding SDK into your iOS project
Link MSSDeviceBinding.xcframework from the OneSpanMobile Security Suite package to your Xcode project.
If you need to share your unique device identifier between several of your own applications, you must configure your project and use the proper access group when calling the API.
To learn more about how to share fingerprints using different kinds of access groups, open the MSSDeviceBinding.doccarchive file from the iOS/Documentation folder of the package and consult the tutorials.
To ensure data privacy during the SDK integration, depending on your integration, you may have to add a privacy file to your application.
If you are using the Device Binding SDK with MSSCDDC or MSSDigipass, you must indicate that the device ID is recorded in your app's PrivacyInfo.xcprivacy file. Do this by adjusting the following settings:
If you are using the Device Binding SDK with MSSCDDC SDK,
NSPrivacyCollectedDataTypeTrackingmust be set to true.If you are using the Device Binding SDK with MSSDigipass SDK,
NSPrivacyCollectedDataTypeLinkedmust be set to true.
You are now ready to use the Device Binding SDK. For more information on the methods, see Obtain the device fingerprint.
API reference documentation and sample applications
To learn more about the public APIs and their functions, exceptions, and error codes, refer to the technical documentation that is included in the product package for each SDK and each platform. In the product package, you can also find the sample applications provided for each platform to see examples of how the SDKs can be used.
These sample apps are intended only to demonstrate basic scenarios and SDK usage. They are not designed to be copied directly into production projects!