<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "PassKit",
  "identifier" : "/documentation/PassKit/VerifyIdentityWithWalletButton",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "PassKit (Apple Pay and Wallet)",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:16_PassKit_SwiftUI30VerifyIdentityWithWalletButtonV"
  },
  "title" : "VerifyIdentityWithWalletButton"
}
-->

# VerifyIdentityWithWalletButton

A type that displays a button to present the identity verification flow.

```
@MainActor @preconcurrency struct VerifyIdentityWithWalletButton<Fallback> where Fallback : View
```

## Overview

Use this structure as the SwiftUI equivalent to [`PKIdentityButton`](/documentation/PassKit/PKIdentityButton). The system allows one in-progress identity request at a time. Otherwise, it returns a [`PKIdentityError.Code.requestAlreadyInProgress`](/documentation/PassKit/PKIdentityError-swift.struct/Code/requestAlreadyInProgress) error.

This example shows an implementation of the Verify Identity with Wallet button. For more information, see [Requesting identity data from a Wallet pass](/documentation/PassKit/requesting-identity-data-from-a-wallet-pass).

```swift
// Create an identity request.
func createRequest() -> PKIdentityRequest {
    let descriptor = PKIdentityDriversLicenseDescriptor()
    descriptor.addElements([.age(atLeast: 18)],
                            intentToStore: .willNotStore)
    descriptor.addElements([.givenName, .familyName, .portrait],
                            intentToStore: .mayStore(days: 30))

    let request = PKIdentityRequest()
    request.descriptor = descriptor
    // The merchant ID you configured in your Apple Developer account.
    request.merchantIdentifier = <YOUR_MERCHANT_ID> 
    // The nonce your server generates.
    request.nonce = <YOUR_NONCE_VALUE> 
}
```

```swift
// Show the Verify Identity with Wallet button and handle the identity request result.
@ViewBuilder var verifiyIdentityButton: some View {
    VerifyIdentityWithWalletButton(
        .verifyIdentity,
        request: createRequest(),
    ) { result in
        switch result {
        case .success(let document):
            // Securely transfer the document to the server for decryption and verification.
        case .failure(let error):
            switch error {
            case PKIdentityError.cancelled:
                // Handle the cancellation error.
            default:
                // Handle other errors.
            }
        }
    } fallback: {
        // Verify the person's identity another way.
    }
}
```

## Topics

### Creating the button

[`init(_:action:)`](/documentation/PassKit/VerifyIdentityWithWalletButton/init(_:action:))

Creates a verify identity button that starts the identity authorization flow.

[`init(_:request:onCompletion:)`](/documentation/PassKit/VerifyIdentityWithWalletButton/init(_:request:onCompletion:))

Creates a verify identity button that starts the identity authorization flow, with a completion handler.

[`init(_:request:onCompletion:fallback:)`](/documentation/PassKit/VerifyIdentityWithWalletButton/init(_:request:onCompletion:fallback:))

Creates a verify identity button that starts the identity authorization flow, with a fallback view to use if the app can’t start the flow.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)