Configurare l'app dello smartphone per i quadranti push
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per il marketplace canonico, l'app Telefono è il modo principale in cui
l'utente interagisce con l'app.
Impostare un quadrante
Quando l'utente seleziona un quadrante nell'app per smartphone, il flusso successivo per impostare il quadrante è suddiviso in due parti:
Installazione: installa il quadrante utilizzando Watch Face Push, avviato
tramite MessageClient. Questo passaggio è semplice e utilizza addWatchFace o updateWatchFace, attivati tramite MessageClient dallo smartphone allo smartwatch.
Potrebbe non essere necessaria alcuna azione. Il marketplace potrebbe già avere
il controllo del quadrante attivo.
Potrebbe non essere necessario alcun intervento da parte dell'utente. L'app dispone delle autorizzazioni
necessarie per impostare il quadrante attivo e può farlo direttamente utilizzando
setWatchFaceAsActive().
Potrebbero essere necessarie indicazioni su come accettare le richieste di autorizzazione o su come impostare manualmente il quadrante utilizzando una pressione prolungata o tramite un'app complementare.
Risposta all'installazione
Per facilitare la fase di attivazione, la fase di installazione deve restituire
le seguenti informazioni dallo smartwatch allo smartphone:
Il risultato del tentativo di installazione
Il risultato di isWatchFaceActive() per determinare se l'app ha già
il quadrante attivo.
Se setWatchFaceAsActive() è già stato chiamato in passato: l'app Wear OS deve monitorare e conservare queste informazioni localmente. Questa chiamata API
può essere utilizzata una sola volta.
Attivazione
Dopo l'installazione, la risposta potrebbe indicare che l'app ha già
il quadrante attivo. Tuttavia, se non lo fa, l'app potrebbe scegliere di mostrare un
pulsante per impostare il quadrante come attivo.
Scenario 1: tutti i tentativi di impostare il quadrante attivo sono esauriti
Se la risposta all'installazione indica che setWatchFaceAsActive() è
già stato chiamato in passato, il pulsante dovrebbe portare a una schermata
informativa sullo smartphone, che mostra all'utente come toccare e tenere premuto il quadrante per
impostarlo manualmente su quello che preferisce.
Scenario 2: prova a impostare il quadrante attivo
Lo smartphone dovrebbe indicare allo smartwatch di verificare l'autorizzazione
SET_PUSHED_WATCH_FACE_AS_ACTIVE necessaria:
Se l'utente ha già concesso l'autorizzazione, procedi chiamando
setWatchFaceAsActive().
Se l'utente ha precedentemente negato l'autorizzazione, lo smartwatch deve
comunicarlo allo smartphone, dove può essere mostrata una schermata informativa
che spiega la necessità dell'autorizzazione e come concederla manualmente.
Se l'autorizzazione non è stata richiesta in precedenza, lo smartwatch deve
chiedere allo smartphone di mostrare un momento educativo che guidi l'utente su come
accettare le autorizzazioni sullo smartwatch, che deve procedere a richiedere
l'autorizzazione.
Se l'utente concede l'autorizzazione, lo smartwatch dovrebbe chiamare
setWatchFaceAsActive().
In caso contrario, l'orologio deve indicare allo smartphone di mostrare una schermata
informativa che spiega la necessità dell'autorizzazione e come concederla
manualmente.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-08-29 UTC.
[null,null,["Ultimo aggiornamento 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."]]