Cómo configurar tu app para teléfonos para enviar caras de reloj
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En el mercado canónico, la app para teléfonos es la forma predominante en la que el usuario interactúa con la app.
Cómo establecer una cara de reloj
Cuando el usuario selecciona una cara de reloj en la app para teléfonos, el flujo posterior para establecer la cara de reloj tiene dos partes:
Instalación: Instala la cara de reloj con Watch Face Push, que se inicia a través de MessageClient. Este paso es sencillo y usa addWatchFace o updateWatchFace, que se activan con MessageClient desde el teléfono hacia el reloj.
Es posible que no sea necesario realizar ninguna acción. Es posible que el mercado ya tenga el control de la cara de reloj activa.
Es posible que no se requiera la intervención del usuario. La app tiene los permisos necesarios para establecer la cara de reloj activa y puede hacerlo directamente con setWatchFaceAsActive().
Es posible que se necesite orientación, ya sea sobre cómo aceptar solicitudes de permisos o cómo configurar manualmente la cara del reloj con un gesto de presión prolongada o a través de una app complementaria.
Respuesta de instalación
Para facilitar la fase de activación, la fase de instalación debe devolver la siguiente información del reloj al teléfono:
Resultado del intento de instalación
El resultado de isWatchFaceActive() para determinar si la app ya tiene la cara de reloj activa.
Indica si setWatchFaceAsActive() ya se llamó en el pasado. La app para Wear OS debe hacer un seguimiento de esta información y conservarla de forma local. Esta llamada a la API solo se puede usar una vez.
Activación
Después de la instalación, la respuesta puede indicar que la app ya tiene la cara de reloj activa. Sin embargo, si no lo hace, la app puede optar por mostrar un botón para establecer la cara de reloj como activa.
Situación 1: Se agotaron todos los intentos para establecer la cara de reloj activa
Si la respuesta de la instalación indicó que ya se había llamado a setWatchFaceAsActive() en el pasado, el botón debería dirigir a una pantalla de aprendizaje en el teléfono, en la que se le muestre al usuario cómo mantener presionado el dial del reloj para configurarlo manualmente en el que desee.
Situación 2: Intenta establecer la cara de reloj activa
El teléfono debe indicarle al reloj que verifique el permiso SET_PUSHED_WATCH_FACE_AS_ACTIVE necesario:
Si el usuario ya otorgó el permiso, continúa con la llamada a setWatchFaceAsActive().
Si el usuario rechazó el permiso anteriormente, el reloj debe comunicar esto al teléfono, donde se puede mostrar una pantalla educativa que explique la necesidad del permiso y cómo otorgarlo manualmente.
Si no se solicitó el permiso antes, el reloj debe indicarle al teléfono que muestre un momento educativo que guíe al usuario sobre cómo aceptar permisos en el reloj, y el reloj debe proceder a solicitar el permiso.
Si el usuario otorga el permiso, el reloj debe llamar a setWatchFaceAsActive().
De lo contrario, el reloj debe indicarle al teléfono que muestre una pantalla educativa en la que se explique la necesidad del permiso y cómo otorgarlo de forma manual.
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-08-29 (UTC)
[null,null,["Última actualización: 2025-08-29 (UTC)"],[],[],null,["# Configure your phone app for Watch Face Push\n\nFor the canonical marketplace, the phone app is the predominant way in which\nthe user interacts with the app.\n\nSet a watch face\n----------------\n\nWhen the user selects a watch face in the phone app, there are two parts to the\nsubsequent flow to set the watch face:\n\n1. **Installation:** Install the watch face using Watch Face Push, initiated through `MessageClient`. This step is straightforward, using either `addWatchFace` or `updateWatchFace`, triggered using `MessageClient` from the phone to the watch.\n2. **Activation:** [Set the installed watch face as active](/training/wearables/watch-face-push/wear-os-app#set-watch-face-as-active). This step has several possible paths, depending on the permission state:\n - There may be **no action needed**. The marketplace may already have control of the active watch face.\n - There may be **no user intervention needed** . The app has the necessary permissions to set the active watch face, and can do so directly using `setWatchFaceAsActive()`.\n - There may be **guidance needed**, either as to how to accept permission requests, or how to manually set the watch face using a long-press gesture or through a companion app.\n\nInstallation response\n---------------------\n\nTo facilitate the **Activation** phase, the **Installation** phase should return\nthe following information from the watch to the phone:\n\n- The outcome of the installation attempt\n- The result of `isWatchFaceActive()` - to determine whether the app already has the active watch face.\n- Whether `setWatchFaceAsActive()` has already been called in the past - the Wear OS app should track and persist this information locally. *This API\n call can only be used once.*\n\nActivation\n----------\n\nFollowing the installation, the response may indicate that the app already has\nthe active watch face. However if it does not, then the app may choose to show a\nbutton to **set watch face as active**.\n\n### Scenario 1: All attempts to set the active watch face are exhausted\n\nIf the response from installation indicated that `setWatchFaceAsActive()` had\nalready been called in the past, then the button should lead to an education\nscreen on the phone, showing the user how to touch \\& hold on the watch face to\nmanually set it to the one they want.\n\n### Scenario 2 - Try to set the active watch face\n\nThe phone should instruct the watch to check for the necessary\n`SET_PUSHED_WATCH_FACE_AS_ACTIVE` permission:\n\n- If the user has **already granted it**, proceed to calling setWatchFaceAsActive().\n- If the user has **previously denied the permission**, the watch should communicate this back to the phone, where an education screen can be shown explaining the need for the permission and how to manually grant it.\n- If the **permission has not been requested before**, the watch should\n instruct the phone to show an educational moment guiding the user on how to\n accept permissions on the watch, and the watch should proceed to request the\n permission.\n\n - If the user grants the permission, the watch should then call `setWatchFaceAsActive()`.\n - Otherwise the watch should instruct the phone to show an education screen explaining the need for the permission and how to manually grant it."]]