Orchestration SDKs

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:

  1. In the Project tree view of your Android Studio project, open the build.gradle.kts file.

  2. Add the pingonemfa module as a dependency:

    Gradle dependency for the pingonemfa module
    dependencies {
        implementation("com.pingidentity.sdks:davinci:2.2.0")
        implementation("com.pingidentity.sdks:pingonemfa:{latest_android_mfa_vers}")
    }

The module declares the FOREGROUND_SERVICE and FOREGROUND_SERVICE_REMOTE_MESSAGING permissions in its own manifest, and they merge into your app automatically.

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:

Initializing the pingonemfa module
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

Geo.NORTH_AMERICA

Europe

Geo.EUROPE

Canada

Geo.CANADA

Australia

Geo.AUSTRALIA

Singapore

Geo.SINGAPORE