From 7488aa0bffaf35951b3630ba8b452176ccad26d9 Mon Sep 17 00:00:00 2001 From: Berend Sliedrecht <61358536+berendsliedrecht@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:19:07 +0100 Subject: [PATCH] feat: return session transcript (#6) * fix(android): set correct data in plugin Signed-off-by: Berend Sliedrecht * feat: return the mdoc session transcript Signed-off-by: Berend Sliedrecht --------- Signed-off-by: Berend Sliedrecht --- .../java/id/animo/mdocdatatransfer/MdocDataTransfer.kt | 7 +++++-- src/MdocDataTransfer.ts | 1 + src/MdocDataTransferEvent.ts | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/id/animo/mdocdatatransfer/MdocDataTransfer.kt b/android/src/main/java/id/animo/mdocdatatransfer/MdocDataTransfer.kt index d4d87c9..7b74635 100644 --- a/android/src/main/java/id/animo/mdocdatatransfer/MdocDataTransfer.kt +++ b/android/src/main/java/id/animo/mdocdatatransfer/MdocDataTransfer.kt @@ -53,7 +53,10 @@ class MdocDataTransfer( is DeviceRequest -> { sendEvent( MdocDataTransferEvent.ON_REQUEST_RECEIVED, - mapOf(("deviceRequest" to request.deviceRequestBytes.asList())) + mapOf( + ("deviceRequest" to request.deviceRequestBytes.asList()), + ("sessionTranscript" tot request.sessionTranscriptBytes.asList()) + ) ) } } @@ -85,4 +88,4 @@ class MdocDataTransfer( fun shutdown() { NfcEngagementService.disable(currentActivity as ComponentActivity) } -} \ No newline at end of file +} diff --git a/src/MdocDataTransfer.ts b/src/MdocDataTransfer.ts index 3ad636f..5954250 100644 --- a/src/MdocDataTransfer.ts +++ b/src/MdocDataTransfer.ts @@ -30,6 +30,7 @@ class MdocDataTransfer { (payload) => cb({ deviceRequest: new Uint8Array(payload.deviceRequest), + sessionTranscript: new Uint8Array(payload.sessionTranscript), }) ) } diff --git a/src/MdocDataTransferEvent.ts b/src/MdocDataTransferEvent.ts index 89d79df..f0f4c09 100644 --- a/src/MdocDataTransferEvent.ts +++ b/src/MdocDataTransferEvent.ts @@ -7,4 +7,5 @@ export type OnResponseSendPayload = null export type OnRequestReceivedEventPayload> = { deviceRequest: T + sessionTranscript: T }