> For the complete documentation index, see [llms.txt](https://ftcoders.first-tech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/area-do-desenvolvedor/fazendo-download-do-sdk.md).

# Fazendo download do SDK

O acesso ao repositório Nexus deve ser configurado no arquivo build.gradle para que o SDK Tap to Phone seja corretamente importado no projeto. O repositório Nexus contém as versões de staging e produção do SDK. Siga os passos abaixo para completar a configuração:

{% stepper %}
{% step %}

### Adicione o repositório Nexus ao arquivo settings.gradle.kts do projeto:

É recomendado adicionar o repositório Nexus no arquivo "settings.gradle.kts" . Isso garante que o repositório esteja globalmente disponível para todos os módulos, evitando repetições desnecessárias.
{% endstep %}

{% step %}

### Configure o repositório Nexus com credenciais:

No bloco repositories, adicione a configuração do Nexus com as credenciais fornecidas.
{% endstep %}
{% endstepper %}

Exemplo: Adicione o seguinte bloco de código no "settings.gradle.kts" dentro de&#x20;

dependencyResolutionManagement > allprojects > repositories.&#x20;

```
        maven {
            setUrl(File("sdk/libs/repository"))
        }
        maven {
            name = "Nexus"
            url = uri("https://nexus.first-tech.net/repository/taponphone-dock/")
            credentials {
                username = "USER"
                password = "PASSWORD"
            }
        }
```

A configuração do Nexus precisa estar proxima do exemplo abaixo

<figure><img src="/files/rMkDOvcOQ7AnFQbv1W0w" alt=""><figcaption></figcaption></figure>

{% hint style="info" %} <mark style="color:$warning;">Considere que o nome de usuário e senha do Nexus serão fornecidos durante o processo de integração(onboarding) pelo provedor do repositório, que pode ser a First Tech ou a empresa que adquiriu o produto sob o modelo de white-label.</mark>

{% endhint %}

Adicione o seguinte bloco de código no arquivo gradle.properties

```
MYAPP_UPLOAD_STORE_FILE=my-release-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=Ftech123#
MYAPP_UPLOAD_KEY_PASSWORD=Ftech123#
```

O arquivo precisa fica da seguinte maneira

<figure><img src="/files/IMNit7B83jVtHiMqXF18" alt=""><figcaption></figcaption></figure>

### Configure o SDK no arquivo build.gradle do módulo do aplicativo

Adicione seguinte bloco de código no arquivo "build.gradle(app)"

```
signingConfigs {
    create("release") {
        storeFile =
            file("$rootDir/app/" + (project.findProperty("MYAPP_UPLOAD_STORE_FILE") as String))
        storePassword = project.findProperty("MYAPP_UPLOAD_STORE_PASSWORD") as String
        keyAlias = project.findProperty("MYAPP_UPLOAD_KEY_ALIAS") as String
        keyPassword = project.findProperty("MYAPP_UPLOAD_KEY_PASSWORD") as String
    }
}
```

O arquivo ficara dessa maneira.

<figure><img src="/files/KSqfJfnxA9wlkGpDI2wn" alt=""><figcaption></figcaption></figure>

Ainda no arquivo "build.gradle(app)"

Crie um buildType de homologação, o de release por default já existe. Com o bloco de código de exemplo abaixo.&#x20;

```
create("hml") {
    isDebuggable = false
    resValue("string", "app_name", "[HML] Kotlin")
    applicationIdSuffix = ".hml"
    buildConfigField("String", "COMPANY_NAME", "\"XXXXXXXXXXXXXXXXXXXXXXXXXXX\"")
    buildConfigField("String", "TERMINAL_NUMBER", "\"XXXXXXXXXXXXXXXXXXXXXXXXXXX\"")
    buildConfigField("String", "SDK_SCOPE", "\"https://mpptestce.onmicrosoft.com/9c64e445-d90c-4438-91cf-9fe1468ab905/.default\"")
    buildConfigField("String", "SKD_CLIENT_ID", "\"XXXXXXXXXXXXXXXXXXXXXXXXXXX\"")
    buildConfigField("String", "SDK_CLIENT_SECRET", "\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"")
    buildConfigField("String", "CLIENT_ID", "\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"")
    buildConfigField("String", "CLIENT_SECRET", "\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"")
    signingConfig = signingConfigs.getByName("release")
}
```

Segue exemplo da criação de um buildType "hml"<br>

<figure><img src="/files/NMByd9Sm15kchBJ1KSUi" alt=""><figcaption></figcaption></figure>

Ainda no arquivo "build.gradle(app)"\
Configure as dependências do SDK utilizando o Version Catalog. No bloco de dependências do módulo principal, declare as implementações específicas para os ambientes de `hml` e `release` apontando para as referências do arquivo `libs.versions.toml`

Exemplo

```
"hmlImplementation"(libs.taponphone.sdk.v2.homol)
"releaseImplementation"(libs.taponphone.sdk.v2.release)
```

<figure><img src="/files/FnmLegaepUMj00s5L4Z2" alt=""><figcaption></figcaption></figure>

Como uma melhor prática de programação, o caminho dessas variáveis é configurado para ser recuperado do arquivo libs.versions.toml.

<figure><img src="/files/BgZkaekEahcUyibUxkGw" alt=""><figcaption></figcaption></figure>

Neste ponto, você pode executar o comando 'Sincronizar Projeto com Arquivos Gradle' para sincronizar o projeto.\ <br>

Após as configurações feitas ,ao sincronizar e quando não ocorrer nenhum erro.A saída esperada no console deve ser: `BUILD SUCCESSFUL`.

<figure><img src="/files/3liq5Oddn4Dyh7sm1Lq5" alt=""><figcaption></figcaption></figure>

Obs: Voce pode verificar se a biblioteca foi baixado através do seguinte caminho .\
Va em "ExternalLibraries"\
\
![](/files/Bq6Fdh5wCJLLsQ8JBB8v)

E busque por "tap", se a biblioteca estiver estiver aparecendo ,significa que foi feito o download com sucesso.\
\
![](/files/EBX7PjoHzVXs2SyyGqyS)&#x20;


---

# 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://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/area-do-desenvolvedor/fazendo-download-do-sdk.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.
