Implement the PingIDSdkEvents interface (Android)

The PingIDSdkEvents interface needs to be implemented by an activity or a class that you’ll be using during the authentication of your user. This is the mechanism that the PingID SDK server uses in order to communicate with the customer mobile application, and notify it about certain events.

Pairing events

onPairingOptionsRequired(List<String> availableTrustLevels, DeviceDetails deviceDetails):

  • Notifies the customer mobile application that the device can be paired, and that the user or the app need to specify how to proceed: Pair the device as a primary device, a trusted device or ignore the request.

onPairingOptionsRequiredWithPasscode(List<String> availableTrustLevels, String deviceName):

  • Similar to onPairingOptionsRequired, but is made on a second device when the primary device of the user is not accessible. In this state, the user should be prompted to choose how to proceed (pair as primary/trusted, or ignore the device) and also enter the one time password (OTP) from a primary/trusted device.

onPairingProgress(String msg):

  • Notifies the customer mobile application about progress of the pairing process.

onPairingCompleted\(PIDActionStatus status, PIDErrorDomain pidErrorDomain\):

  • Notifies the customer mobile application about the completion of the pairing process.
  • PIDActionStatus specifies success or failure.
  • PIDErrorDomain specifies the error in case of a failure.

onIgnoreDeviceCompleted(PIDActionStatus status, PIDErrorDomain pidErrorDomain):

  • Notifies the customer mobile application about the completion of an ignore device operation.
  • PIDActionStatus specifies success or failure.
  • PIDErrorDomain specifies the error in case of a failure.

Authentication events

onAuthenticationRequired(Bundle data):

  • Indicates that the customer mobile application should verify the user’s identity, using a PIN code, fingerprint, or any other means. The Bundle object contains several data items:
    • Client parameters (key: client_context): a string passed by the customer server side that can be used to customize the behavior and configuration of the customer mobile application.
    • Timeout: specifies the timeout for this authentication flow.

onAuthenticationCompleted(PIDActionStatus status, PIDActionType actionType, PIDErrorDomain pidErrorDomain):

  • Returns the result of the authentication after the PingID SDK component has updated the PingID SDK server with the results.

  • PIDActionStatus contains the result (SUCCESS or FAILURE) of the process.

  • PIDActionType contains the action that the user has chosen (approve/deny/block).

  • PIDErrorDomain contains a more specific error, in cases of failure.

onAuthenticationCancelled():

  • Indicates that an authentication request has been cancelled, for the current session.

onOneTimePasscodeChanged(String newOneTimePasscode):

  • Indicates that the One Time Passcode value for this device has changed.

General events

onGeneralMessage(String msg):

  • Passes general information from the PingID SDK component to the customer mobile application for debugging.

onError(Throwable throwable, String description):

  • Indicates an error in an asynchronous operation made by PingID SDK.

onGooglePlayServicesStatusReceived(int status):

  • Indicates that PingID SDK checked the availability and version of Google Play services. If the value returned is 2 (ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED), then the customer mobile application is required to prompt the user to upgrade the Google Play service for the PingID SDK component to fully work.

onLogsSentToServer(PingID.PIDActionStatus status, String supportId):

  • Indicates that uploading logs to the PingID SDK server has completed. Arguments:
    • status contains the result (SUCCESS or FAILURE) of the process.
    • supportId contains a number that can be used by the developer as a reference, when contacting Ping Identity’s support to trace the error.