scanNfcMdocReader
Performs NFC engagement as a reader.
This uses scanNfcTag to show a dialog prompting the user to tap the mdoc.
When a connection has been established, onHandover is called with the created transport as well as the device engagement and handover structures used.
If the given transport is for org.multipaz.mdoc.connectionmethod.MdocConnectionMethodNfc the onHandover callback is called in the same coroutine used for interacting with the tag to ensure continued communications with the remote NFC tag reader and the updateMessage
parameter to onHandover will be non-null
which the application can use to update the message in the NFC scanning dialog. Otherwise onHandover is called in the calling coroutine right after the NFC interaction with updateMessage
set to null
. In either case, any exception thrown in onHandover will be thrown from this method.
Return
true
if onHandover was invoked, false
if no handover happened.
Parameters
the message to display in the NFC tag scanning dialog or null
to not show a dialog. Not all platforms supports not showing a dialog, use org.multipaz.nfc.nfcTagScanningSupportedWithoutDialog to check at runtime if the platform supports this.
the MdocTransportOptions used to create new MdocTransport instances.
the factory used to create MdocTransport instances.
used to choose a connection method if the remote mdoc is using NFC static handover.
the connection methods to offer if the remote mdoc is using NFC Negotiated Handover.
: Will be called on successful handover.