<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ProximityReader",
  "identifier" : "/documentation/ProximityReader/MobileDocumentReader/prepare(using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ProximityReader"
    ],
    "preciseIdentifier" : "s:15ProximityReader014MobileDocumentB0C7prepare5usingAA0cdB7SessionCAC5TokenVSg_tYaKF"
  },
  "title" : "prepare(using:)"
}
-->

# prepare(using:)

Configures the device to read mobile documents.

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

## Parameters

`token`

An optional reader token generated from your server.

## Return Value

[`MobileDocumentReaderSession`](/documentation/ProximityReader/MobileDocumentReaderSession) when successful.

## Discussion

This method prepares the device for mobile document reading.

This method returns a [`MobileDocumentReaderSession`](/documentation/ProximityReader/MobileDocumentReaderSession) object,
which you use to read mobile documents.

After calling this method, there are three possible scenarios:

- The method returns an existing [`MobileDocumentReaderSession`](/documentation/ProximityReader/MobileDocumentReaderSession) immediately
  if that session is still valid.
- The method retrieves and returns a new [`MobileDocumentReaderSession`](/documentation/ProximityReader/MobileDocumentReaderSession) from
  the server.
- This method throws a [`MobileDocumentReaderError`](/documentation/ProximityReader/MobileDocumentReaderError) if a problem occurs.

> Throws: A ``doc://com.apple.ProximityReader/documentation/ProximityReader/MobileDocumentReaderError`` if the method fails to configure the device.

---

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)