> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/how-the-apps-work/screens/assets/code-scanner.md).

# Code scanner

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). Platforms: iOS and Android. [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/screens/assets/code-scanner.md).
{% endhint %}

Scan an asset's QR code or barcode with the camera, or read its Smart Tag (NFC), to find the asset, fill in its code, or search the list (Android uses the ZXing library's scanner).

* **Where:** iOS: the scan button on [Asset registers](https://docs.snapfix.com/how-the-apps-work/screens/assets/registers.md) and [Asset list](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-list.md), the asset list's "Search by code" and NFC buttons, the overflow menu's scan items, and the code rows of [Asset attributes](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-attributes.md). Android: the floating scan button on [Asset registers](https://docs.snapfix.com/how-the-apps-work/screens/assets/registers.md), the "+" menus' "Scan Asset QR or Barcode" and "Scan Asset Smart Tag" (registers and [Asset list](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-list.md)), and the code rows of [Asset attributes](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-attributes.md).
* **Who:** any member. A scan only finds an asset or fills a field; creating from a scan needs the create permission.
* **Feature:** [Asset codes](https://docs.snapfix.com/product/features/assets/asset-codes.md)

The web has no scanner: it shows, copies, downloads and removes codes on [Asset detail](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-detail.md#code-dialog-web), but cannot set them.

## Layout

* **iOS camera view** (full screen): the title "Scan a QR Code", "Scan a Barcode" or "Scan a QR or Barcode", a close button, and a torch button (hidden when the camera has no torch). The view stops on the first code it reads, vibrates and plays a beep.
* **Android:** the ZXing capture screen with the prompt "Scan a QR or Barcode" (from a code row: "Scan a QR Code" or "Scan a Barcode Code"). The phone vibrates.
* **NFC reader:** a sheet that waits for a tag held to the phone (iOS `AssetNFCScannerVC` or the system sheet; Android `ScanNfcBottomSheet`).

## Inputs

| Field             | Type          | Required              | Default                  | Rules and messages                                                                                                                                                                                                           |
| ----------------- | ------------- | --------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Code              | Camera scan   | Yes, to finish        | None                     | iOS reads QR, Aztec and Data Matrix codes, and the barcodes UPC-E, Code 39, Code 39 mod 43, EAN-13, EAN-8, Code 93, Code 128, PDF417, Interleaved 2 of 5 and ITF-14, or both kinds. Android's main scanner reads every type. |
| Smart Tag         | NFC           | Yes, for the NFC path | None                     | The tag's serial. Needs NFC: "Your device doesn't support NFC" (iOS), "*Your device doesn't support NFC" and "* Please enable NFC from the settings" (Android).                                                              |
| Camera permission | System prompt | Yes                   | Asked when a scan starts | Android: "Snapfix needs permission to use the camera to scan QR/Barcode", then a settings dialog when the system has refused.                                                                                                |

## Actions

| Action                            | Who                                                                                                         | What happens                                                                                                                                                                                                                                                                                                                                                                                                    | API                                 |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| Scan to find an asset             | Any member                                                                                                  | Looks the value up in the device copy (iOS: in the registers the user belongs to). Found: "Asset found. What do you want to do next?" with "View Asset" and "Create Task". Not found: "The scanned Asset does not exist in this Account. Would you like to create it?" with "Cancel" and "Create Asset". iOS matches the value as part of a stored value and takes the first row, so it can open another asset. | None; the lookup runs on the device |
| "View Asset"                      | Any member                                                                                                  | Opens [Asset detail](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-detail.md) (Android goes through the asset's register list).                                                                                                                                                                                                                                                               | None                                |
| "Create Task"                     | Create permission                                                                                           | Starts a task linked to the asset.                                                                                                                                                                                                                                                                                                                                                                              | Device copy, then the sync          |
| "Create Asset"                    | Create permission (the create buttons hide without it on iOS)                                               | Starts a new asset with the scanned value in its code attribute, then [Asset attributes](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-attributes.md).                                                                                                                                                                                                                                        | Device copy, then the sync          |
| Scan into a code row              | Anyone on [Asset attributes](https://docs.snapfix.com/how-the-apps-work/screens/assets/asset-attributes.md) | Fills the row with the scanned text.                                                                                                                                                                                                                                                                                                                                                                            | Saved with the attributes           |
| "Search by code" (iOS asset list) | Any member                                                                                                  | Puts the scanned text into the search field.                                                                                                                                                                                                                                                                                                                                                                    | None                                |
| Torch (iOS)                       | Anyone                                                                                                      | Turns the light on or off.                                                                                                                                                                                                                                                                                                                                                                                      | None                                |
| Close                             | Anyone                                                                                                      | Leaves without a result.                                                                                                                                                                                                                                                                                                                                                                                        | None                                |

## States

* **Loading:** the camera starts in the background.
* **Not supported:** iOS: "Scanning not supported" / "Your device does not support scanning", with "OK".
* **Permission refused:** the system prompt; Android then offers its settings dialog. Without camera access no code is read.
* **No NFC:** the Smart Tag path shows the NFC message and does not start.
* **Offline (mobile):** works offline; the lookup uses the device copy.

## Dialogs and sheets

* **Found or not found:** iOS `AssetFoundVC`, Android `AssetFoundResultBottomSheet`, with the texts in [Actions](#actions).
* **NFC reader:** see [Layout](#layout).

## Platform differences

| Topic        | iOS                                                                          | Android                                       |
| ------------ | ---------------------------------------------------------------------------- | --------------------------------------------- |
| Scanner      | Its own camera view with three modes (QR, barcode, both), a torch and a beep | ZXing, every type, one prompt; vibration only |
| Lookup       | Partial match, first row                                                     | The device copy                               |
| Entry points | Scan buttons, "Search by code", overflow menu                                | Floating scan button, the "+" menus           |
| "View Asset" | Opens the asset                                                              | Opens the asset through its register's list   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/how-the-apps-work/screens/assets/code-scanner.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
