MdocNdefService

abstract class MdocNdefService(applicationContext: Context, sendResponse: (ByteArray) -> Unit) : NfcApduService

Base class for implementing NFC engagement according to ISO/IEC 18013-5:2021.

Applications should subclass this and include the appropriate stanzas in its manifest for binding to the NDEF Type 4 tag AID (D2760000850101).

Constructors

Link copied to clipboard
constructor(applicationContext: Context, sendResponse: (ByteArray) -> Unit)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Settings(val source: PresentmentSource, val promptModel: PromptModel, val presentmentModel: PresentmentModel?, val activityClass: Class<out Activity>?, val sessionEncryptionCurve: EcCurve, val useNegotiatedHandover: Boolean, val negotiatedHandoverPreferredOrder: List<String>, val staticHandoverBleCentralClientModeEnabled: Boolean, val staticHandoverBlePeripheralServerModeEnabled: Boolean, val staticHandoverNfcDataTransferEnabled: Boolean, val transportOptions: MdocTransportOptions, val capabilities: Map<Capability, DataItem> = mapOf( Capability.READER_AUTH_ALL_SUPPORT to true.toDataItem(), Capability.EXTENDED_REQUEST_SUPPORT to true.toDataItem() ))

Settings provided by the application for how to configure NFC engagement.

Functions

Link copied to clipboard
abstract suspend fun getSettings(): MdocNdefService.Settings

Must be implemented by the application to specify its preferences/settings for NFC engagement.

Link copied to clipboard
open override fun onCreate()

Called when CombinedNfcService is created by the OS.

Link copied to clipboard
open override fun onDeactivated(reason: Int)

Called when the service is deactivated.

Link copied to clipboard
open override fun onDestroy()

Called when CombinedNfcService is destroyed by the OS.

Link copied to clipboard
open override fun processCommandApdu(encodedCommandApdu: ByteArray, extras: Bundle?): ByteArray?

Called when APDUs arrive