PushNotification

data class PushNotification(val id: String = UUID.randomUUID().toString(), val notificationObject: NotificationObject, val title: String?, val message: String?) : Parcelable

Wrapper model for a PingOne MFA push authentication request.

Produced by com.pingidentity.pingonemfa.commons.PingOneMFA.processRemoteNotification from an incoming FCM com.google.firebase.messaging.RemoteMessage. All user-facing operations (approve, deny) are exposed as suspend functions that return Result.

Constructors

Link copied to clipboard
constructor(id: String = UUID.randomUUID().toString(), notificationObject: NotificationObject, title: String?, message: String?)
constructor(parcel: Parcel)

Restores a PushNotification from a Parcel. Used internally by CREATOR; not intended for direct use.

Types

Link copied to clipboard

Properties

Link copied to clipboard
val id: String

Wrapper-generated unique identifier for this push request.

Link copied to clipboard

Notification body extracted from the FCM data payload, or null if absent.

Link copied to clipboard
val notificationObject: NotificationObject
Link copied to clipboard

Notification title extracted from the FCM data payload, or null if absent.

Functions

Link copied to clipboard
suspend fun approveNotification(context: Context, authenticationMethod: String, numberChallenge: Int? = null): Result<Unit>

Approves this push authentication request.

Link copied to clipboard
suspend fun denyNotification(context: Context): Result<Unit>

Denies this push authentication request.

Link copied to clipboard
open override fun describeContents(): Int

No file descriptors are contained in this parcel.

Link copied to clipboard

Returns the server-provided number options for a PushType.CHALLENGE push, or null when free-form digit entry is expected instead.

Link copied to clipboard

Returns the PushType that describes the interaction model required by this push. UI components should switch on this to decide which approval flow to present.

Link copied to clipboard

Returns true when the server has canceled this authentication request — for example, because the user approved it on another device.

Link copied to clipboard
open override fun writeToParcel(parcel: Parcel, flags: Int)

Flattens this object into a Parcel. Fields are written in the same order they are read in the Parcel constructor.