> For the complete documentation index, see [llms.txt](https://doc.ozforensics.com/oz-knowledge-ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ozforensics.com/oz-knowledge-ru/rukovodstva/rukovodstvo-razrabotchika/sdk/oz-mobile-sdk/ios/poluchenie-licenzii.md).

# Получение лицензии

Для работы SDK требуется лицензия. Сгенерируйте тестовую лицензию самостоятельно [здесь](https://ozforensics.com/developers/try_mobile_sdk) (внимание, страница на английском языке) или свяжитесь с нами по [email](mailto:info@ozforensics.com) для выпуска продуктивной лицензии. Для подготовки лицензии потребуется `bundle id`. Есть два способа добавить лицензию в проект:

1. Переименуйте файл в **forensics.license** и поместите его в проект. Прописывать путь в этом случае не нужно.
2. Обновление лицензии для уже работающего приложения или в том случае, если вы хотите держать лицензию вне проекта: &#x20;

```swift
OZSDK(licenseSources: [.licenseFileName(“forensics.license”)]) { licenseData, error in
      if let error = error {
        print(error)
      }
    }
```

`или`

```swift
OZSDK(licenseSources: [.licenseFilePath(“path_to_file”)]) { licenseData, error in
      if let error = error {
        print(error)
      }
    }
```

&#x20;`LicenseSource` – источник лицензии, `LicenseData` – информация о лицензии. В этот метод встроена проверка наличия активной лицензии, если такая лицензия есть – будет использоваться она, а не та, путь к которой вы указали. Для принудительной замены лицензии используйте метод `setLicense`.

Если при обработке лицензии возникнут ошибки, вы получите сообщение с описанием этих ошибок. Если ошибок нет, система выведет данные о лицензии. Вы также можете запросить эти данные с помощью `OZSDK.licenseData`.

### Возможные ошибки лицензии

<table><thead><tr><th width="347">Сообщение об ошибке</th><th>Что делать</th></tr></thead><tbody><tr><td>License error. License at (your_URI) not found</td><td>Отсутствует файл лицензии. Проверьте наименование и путь к файлу.</td></tr><tr><td>License error. Cannot parse license from (your_URI), invalid format</td><td>Файл лицензии поврежден. Пожалуйста, отправьте его нам по электронной почте.</td></tr><tr><td>License error. Bundle company.application.id is not in the list allowed by license (bundle.id1, bundle.id2)</td><td>Идентификатор приложения отсутствует в списке разрешенных для данной лицензии идентификаторов. Проверьте написание, если все корректно, нужна новая лицензия.</td></tr><tr><td>License error. Current date yyyy-mm-dd hh:mm:ss is later than license expiration date yyyy-mm-dd hh:mm:ss</td><td>Срок действия лицензии истек. Пожалуйста, свяжитесь с нами.</td></tr><tr><td>License is not initialized.</td><td>Лицензия не устанавливалась. Добавьте лицензию в проект.</td></tr></tbody></table>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.ozforensics.com/oz-knowledge-ru/rukovodstva/rukovodstvo-razrabotchika/sdk/oz-mobile-sdk/ios/poluchenie-licenzii.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
