Setting up the pingonemfa module on Android
PingOne Android
Before your app can pair devices or respond to authentication challenges, add the pingonemfa module to your app and initialize it with your PingOne geography.
Adding the module
To add the pingonemfa module to your Android app:
-
In the Project tree view of your Android Studio project, open the
build.gradle.ktsfile. -
Add the
pingonemfamodule as a dependency:Gradle dependency for the pingonemfa moduledependencies { implementation("com.pingidentity.sdks:davinci:2.2.0") implementation("com.pingidentity.sdks:pingonemfa:{latest_android_mfa_vers}") }
|
The module declares the These are required for responding to approve and deny actions on system notification banners. |
Initializing the module
In your application startup code, import the required modules, call initialize, and pass in the geography of the region where your PingOne environment is provisioned:
import com.pingidentity.pingonemfa.commons.Geo
import com.pingidentity.pingonemfa.commons.PingOneMFA
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
CoroutineScope(SupervisorJob()).launch {
PingOneMFA.initialize(Geo.NORTH_AMERICA)
.onFailure { e ->
Log.e("MFA", "Initialization failed: ${e.message}")
}
}
The available geographies are:
| Geography | Value |
|---|---|
North America |
|
Europe |
|
Canada |
|
Australia |
|
Singapore |
|