Skip to content

Commit

Permalink
docs: Add documentation for set interation detail feauture
Browse files Browse the repository at this point in the history
Signed-off-by: Talwinder Kaur <[email protected]>
  • Loading branch information
talwinder50 committed Oct 22, 2024
1 parent 61237fb commit 0a88112
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion cmd/wallet-sdk-gomobile/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,20 @@ val ackTkn = interaction.acknowledgment().serialize()

val ack = Acknowledgment(ackTkn)

// The userID in the examples below are for demonstration purposes only.

test["userID"] = "123456"
let data = try JSONEncoder().encode(test)
let serializedInteractionDetails = String(data: data, encoding: .utf8)!

// Additional Interactions are recorded as part of the wallet’s activity history which are OPTIONAL.
// Upon the conclusion of issuance or presentation flows, the wallet will send a modified acknowledgment request to the downstream project.

ack.setInteractionDetails(serializedInteractionDetails) // SetInteractionDetails extends acknowledgment request with serializedInteractionDetails.

ack.success() // user accepts the credential
ack.reject() // user rejects the credential

// Consider checking the activity log at some point after the interaction
```

#### Swift (iOS) - Issuer-Initiated - Pre-Authorized Code Flow
Expand Down Expand Up @@ -1608,6 +1618,14 @@ interaction.PresentCredentialOpts(PresentCredentialOpts().addScopeClaim(

```

###### Set Interaction Details (OPTIONAL)

```kotlin

val interactionDetailsData = """{"user": "123456"}"""
interaction.PresentCredentialOpts(PresentCredentialOpts().setInteractionDetails(interactionDetailsData))

```

#### Swift (iOS)

Expand Down Expand Up @@ -1863,7 +1881,22 @@ try interaction.presentCredentialOpts(
)

```
###### Set interaction details

```swift

var test = [String : String] ()
test["userId"] = "123456"

let data = try JSONEncoder().encode(test)
let serializedInteractionDetailsData = String(data: data, encoding: .utf8)!

try interaction.presentCredentialOpts(
selectedCreds,
opts: Openid4vpNewPresentCredentialOpts()?.setInteractionDetails(serializedInteractionDetails))
)

```

### Error Codes & Troubleshooting Tips

Expand Down

0 comments on commit 0a88112

Please sign in to comment.