> 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/onboarding/pre-registration-survey.md).

# Pre-registration survey

{% 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/onboarding/pre-registration-survey.md).
{% endhint %}

A short survey from the Snapfix team, shown over the sign-in screen before the person signs in. The title, description, questions and button text come from the survey record.

* **Where:** Android: `LoginActivity`, and the older `LoginUsernameActivity`, request it when the screen opens, while the phone's flag `is_displayed_survey_screen` is off, and open it full screen when a survey comes back. iOS: only `SmsEmailMainLoginVC` requests it, and the app never opens that screen (the launch and sign-out paths open `SmsEmailLoginVC`, which has no survey call), so iOS never shows the survey.
* **Who:** anyone on the sign-in screen; no sign-in is needed. The calls use the shared guest login, and the server picks the survey for the caller's country and device type.
* **Feature:** [Site setup in the app](https://docs.snapfix.com/product/features/onboarding/site-setup.md)

The survey comes from [`GET /v1/guest/survey/prereg`](https://docs.snapfix.com/engineering-reference/api/onboarding.md#get-v1guestsurveyprereg), which also logs each request. Answers and dismissals go to [`POST /v1/guest/survey/prereg`](https://docs.snapfix.com/engineering-reference/api/onboarding.md#post-v1guestsurveyprereg). On Android the survey is asked when the sign-in screen opens, so also of people who have never used Snapfix and of people who are about to sign in to an existing account.

## Layout

Full screen, top to bottom:

1. The Snapfix mark and a close cross at the top right.
2. The survey `title` and `description`.
3. One block per question. A required question ends its label with a red " \*". An info icon shows the question's hint in a tooltip; iOS hides it when the hint is empty and on free-text questions, Android shows it when the hint is not null.
4. The submit button, labelled with `submit_button_text`; iOS shows "SUBMIT" when it is missing.

Only questions with `version` 1 are drawn on iOS and on `LoginUsernameActivity`; `LoginActivity` passes every version, and others draw as empty rows. iOS sorts the questions by `sort_order`; Android keeps the response order. Options with `content_random` 0 are sorted by `sort_order`, others are shuffled; options with `force_to_bottom` go last (iOS sorts them, Android shuffles them too when the rest are shuffled).

## Inputs

| Question (`id`) | Type            | Required                | Default                                                                                      | Rules and messages                                                                                                                                                            |
| --------------- | --------------- | ----------------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `checkboxes`    | Several options | When `mandatory` is set | iOS: options with `default` 1. Android: none, because it reads `value` and ignores `default` | A required question needs one ticked option. An option with `multiline` 1 shows a text box (placeholder `multiline_hint`) while ticked; unticking clears it.                  |
| `radiobuttons`  | One option      | When `mandatory` is set | The option with `default` 1                                                                  | Picking one clears the others and their notes. Same per-option text box.                                                                                                      |
| `dropdown`      | One option      | When `mandatory` is set | The option with `default` 1, otherwise "Choose your answer..."                               | Android inserts that placeholder only when no option is the default, but always disables the first row, so a default first answer cannot be chosen again.                     |
| `multiline`     | Text            | When `mandatory` is set | Empty                                                                                        | The hint is the placeholder (italic on iOS). A required question needs text. iOS sends the text as `multiline_value` of the first option, Android as the component's `value`. |

iOS shows the question's `subtitle` under its label. Android writes the label into that line instead, so the survey's subtitle does not show.

## Actions

| Action                  | Who                                  | What happens                                                                                                                                                                                                                                 | API                            |
| ----------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| Open the sign-in screen | Anyone, while the survey is not done | Requests the survey. Nothing happens when none comes back or the call fails. iOS (on the unused screen) skips the call when `isFreshInstall` is false or the phone is offline, and opens the survey about a second after it arrives.         | `GET /v1/guest/survey/prereg`  |
| Submit                  | Anyone                               | Checks the required questions; a gap opens [Missing answers](#missing-answers) and sends nothing. Otherwise sends the form with `surveyDismiss` 0 and closes on success. iOS then sets `isFreshInstall` to false; Android turns its flag on. | `POST /v1/guest/survey/prereg` |
| Close cross             | Anyone                               | Sends the form as it is with `surveyDismiss` 1, unchecked. iOS closes when the answer arrives; Android closes at once without waiting. The survey can come back next time.                                                                   | `POST /v1/guest/survey/prereg` |
| Leave another way       | Anyone                               | iOS: when the app goes to the background, sends `surveyDismiss` 2 and closes on success. Android: when the screen is destroyed without a send having started, including the system back button, sends `surveyDismiss` 2.                     | `POST /v1/guest/survey/prereg` |

Android builds the sent questions from the rows it has drawn, so a question can be left out or sent twice, and an untouched free-text question can be skipped by the required check.

Besides a submit, these turn the Android flag on, so the survey does not come back: a successful sign-in on `LoginActivity` or by code, registration, password reset and new password, an invited user's password, and a deep link. On iOS, saving the sign-in tokens also sets `isFreshInstall` to false.

## States

* **Loading:** none on the survey; it opens only once it has arrived.
* **Empty:** a survey with no drawable questions shows the title, the description and the button.
* **Error:** a failed save on iOS closes the survey, then toasts the server's message or "Something went wrong. Please try again." on the closed screen. On Android an alert with no title shows the server's message, and "Ok" closes the survey. Either way the answers are lost.
* **No permission:** none.
* **Offline (mobile):** a send shows "No Connection" and "You must be connected to the Internet to carry out this task. Please connect and try again.", nothing is sent, and on submit the survey stays open. On Android the close cross still closes the survey, and the screen then tries a second, "closed" send that also fails.

## Dialogs and sheets

### Missing answers

Title "Snapfix", "Please fill in all required fields marked with an asterisk (\*).", and "Ok". iOS shows it as a bottom sheet with the cancel button hidden. Android shows a bottom sheet with an alert icon, "Ok" and a close icon; its "Cancel" button is hidden. Both leave the survey open.

## Platform differences

| Topic              | iOS                                         | Android                                                                    |
| ------------------ | ------------------------------------------- | -------------------------------------------------------------------------- |
| Shown              | Never: requested only by an unused screen   | When the sign-in screen opens                                              |
| Stops after        | A completed survey, or saved sign-in tokens | A completed survey, or a sign-in, registration, password or deep-link flow |
| Question versions  | Version 1 only                              | `LoginUsernameActivity` version 1 only; `LoginActivity` every version      |
| Question order     | `sort_order`                                | Response order                                                             |
| Default checkboxes | Ticked                                      | Not ticked                                                                 |
| Subtitle           | The survey's subtitle                       | The label again                                                            |
| Close cross        | Waits for the answer                        | Closes at once                                                             |
| Failed save        | Closes, then a toast                        | Alert, then closes                                                         |


---

# 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/onboarding/pre-registration-survey.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.
