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 |
|
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.
-
If you do not already have CocoaPods, install the latest version.
-
In a terminal window, run the following command to create a new Podfile:
pod init
-
Add the following lines to your Podfile:
pod 'FRAuthenticator'
-
Run the following command to install pods:
pod install
Install the Ping (ForgeRock) Authenticator module using Swift Package Manager (SPM)
-
With your project open in Xcode, select File > Add Package Dependencies.
-
In the search bar, enter the Ping SDK for iOS repository URL:
https://github.com/ForgeRock/forgerock-ios-sdk
. -
Select the
forgerock-ios-sdk
package, and then click Add Package. -
In the Choose Package Products dialog, ensure that the
FRAuthenticator
library is added to your target project:Figure 1. Adding the 'FRAuthenticator' module to an iOS project. -
Click Add Package.
-
In your project, import the module:
// Import the Ping (ForgeRock) Authenticator module import FRAuthenticator