> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/transit-digitization/es/implementar-google-transit/ticketing-basado-en-cuentas-abt/notificacion-de-mensaje.md).

# Notificación de mensaje

Las notificaciones son desencadenadas por el Emisor de Tránsito que desea enviar mensajes a usuarios/d tarjetas digitales específicos.

Esta sección ofrece una visión general del flujo de trabajo, incluidos los pasos detallados, diagramas de secuencia y posibles escenarios de error.

### Flujo de trabajo <a href="#workflow" id="workflow"></a>

A continuación se presentan los pasos de alto nivel del flujo de trabajo de notificación de mensajes:

1. **Inicio de la notificación** : El Emisor de Tránsito instruye a D1 Transit para enviar un mensaje a una tarjeta digital objetivo.
2. **Notificación de la cartera**: D1 Transit utiliza la API de notificaciones de Google para enviar una notificación push a la cartera correcta.
3. **Recuperación del mensaje**: El dispositivo se conecta al servidor de Google que se conecta a la plataforma D1 Transit para recuperar el contenido del mensaje.

### Diagrama de secuencia <a href="#sequence-diagram" id="sequence-diagram"></a>

#### Inicio de la notificación <a href="#notification-initiation" id="notification-initiation"></a>

El emisor de Tránsito instruye a D1 Transit para enviar un mensaje a la tarjeta digital especificada utilizando la API handleEvent.

#### Notificación del dispositivo y recuperación del mensaje <a href="#device-notification-and-message-retrieval" id="device-notification-and-message-retrieval"></a>

La plataforma D1 Transit utiliza la API messagesUpdated de Google para enviar una notificación push a la cartera. El dispositivo, a través del servidor de Google, se conecta a D1 Transit para recuperar los detalles del contenido del mensaje que D1 Transit obtiene del Emisor de Tránsito.

**Escenarios de error**

**El dispositivo está desconectado**

Si el dispositivo está desconectado, la solicitud para notificar el mensaje se pone en cola y se enviará al dispositivo tan pronto como se vuelva a conectar.

<figure><img src="https://3364212302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZoFRCpZeaDWwcHYhJY7B%2Fuploads%2F7rytPi1jTMz0zDAJGU7c%2FSequence%20Diagram%20%E2%80%93%20%20Message%20Notification.svg?alt=media&amp;token=7cedb960-e23c-41b8-b57a-982c435bdcd8" alt=""><figcaption></figcaption></figure>


---

# 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.payments.thalescloud.io/transit-digitization/es/implementar-google-transit/ticketing-basado-en-cuentas-abt/notificacion-de-mensaje.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.
