Ping SDKs

Set up your Ping (ForgeRock) Authenticator module project

Android

Set compile options

The Ping SDK for Android requires at least Java 8 (v1.8). Configure the compile options in your project to use this version, or newer.

For example, to specify Java 17, in your build.gradle file, add the following code at the top level:

kotlin {
  jvmToolchain {
    languageVersion.set(JavaLanguageVersion.of(17))
  }
}

Add module dependencies

Add the following dependency to use the Ping (ForgeRock) Authenticator module in your Android applications:

dependencies {
    ...
    implementation 'org.forgerock:forgerock-authenticator:4.6.0'
}

Additional dependencies you may require:

Feature Dependency

Push notifications

com.google.firebase:firebase-messaging:20.2.0

Request notification permissions

To process push notifications successfully on Android 13 (API level 33) and later, the app must request the new Notification runtime permission for sending non-exempt notifications from an app.

Declare the permission

To request the new notification permission from your app, update your app to target Android 13 (API level 33) and declare POST_NOTIFICATIONS in your app’s manifest file, as in the following code snippet:

<manifest ...>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <application ...>
        ...
    </application>
</manifest>

iOS

Install the Ping (ForgeRock) Authenticator module using CocoaPods

CocoaPods is a dependency manager for iOS projects, and is a simple way to integrate the Ping (ForgeRock) Authenticator module into your application.

  1. If you do not already have CocoaPods, install the latest version.

  2. In a terminal window, run the following command to create a new Podfile:

    pod init
  3. Add the following lines to your Podfile:

    pod 'FRAuthenticator'
  4. Run the following command to install pods:

    pod install

Install the Ping (ForgeRock) Authenticator module using Swift Package Manager (SPM)

  1. With your project open in Xcode, select File > Add Package Dependencies.

  2. In the search bar, enter the Ping SDK for iOS repository URL: https://github.com/ForgeRock/forgerock-ios-sdk.

  3. Select the forgerock-ios-sdk package, and then click Add Package.

  4. In the Choose Package Products dialog, ensure that the FRAuthenticator library is added to your target project:

    spm select authenticator module
    Figure 1. Adding the 'FRAuthenticator' module to an iOS project.
  5. Click Add Package.

  6. In your project, import the module:

    // Import the Ping (ForgeRock) Authenticator module
    import FRAuthenticator