---
title: "prepare(using:)"
framework: proximityreader
role: symbol
role_heading: Instance Method
path: "proximityreader/mobiledocumentreader/prepare(using:)"
---

# prepare(using:)

Configures the device to read mobile documents.

## Declaration

```swift
final func prepare(using token: MobileDocumentReader.Token? = nil) async throws -> MobileDocumentReaderSession
```

## Parameters

- `token`: An optional reader token generated from your server.

## Mentioned in

Adopting the Verifier API in your iPhone app Generating reader tokens for the Verifier API

## Return Value

Return Value MobileDocumentReaderSession when successful.

## Discussion

Discussion This method prepares the device for mobile document reading. This method returns a MobileDocumentReaderSession object, which you use to read mobile documents. After calling this method, there are three possible scenarios: The method returns an existing MobileDocumentReaderSession immediately if that session is still valid. The method retrieves and returns a new MobileDocumentReaderSession from the server. This method throws a MobileDocumentReaderError if a problem occurs. note: A MobileDocumentReaderError if the method fails to configure the device.

## See Also

### Preparing the device for reading mobile documents

- [MobileDocumentReader.Token](proximityreader/mobiledocumentreader/token.md)
