Contents

checkCanRequestDocument(_:completion:)

Returns whether an identity document is available to request.

Declaration

func checkCanRequestDocument(_ descriptor: any PKIdentityDocumentDescriptor, completion: @escaping  @Sendable (Bool) -> Void)
func canRequestDocument(_ descriptor: any PKIdentityDocumentDescriptor) async -> Bool

Parameters

  • descriptor:

    The object that describes the document the app requests.

  • completion:

    The callback the system invokes after determining whether you can request the document you describe.

Mentioned in

Discussion

This method checks whether you have the correct entitlements and if the device has an ID in the Wallet app.

// Check whether the app can request the document.
controller.checkCanRequestDocument(descriptor) { canRequest in
    if canRequest {
        // Show the identity button for triggering the request.
    } else {
        // Hide the request button.
    }
}

See Also

Requesting a document