Se l'utente scollega l'Azione smart home da Google Assistant, il fulfillment riceve un'intent action.devices.DISCONNECT
. Questo intent indica che Assistant non invierà altri intent per questo utente e che il tuo servizio cloud non dovrebbe più chiamare le API Google Home Graph (Richiesta di sincronizzazione e Report State) per i suoi dispositivi.
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.DISCONNECT", }] }
JSON
{}
Node.js
const {smarthome} = require('actions-on-google'); const app = smarthome(); // ... app.onDisconnect((body, headers) => { // TODO Disconnect user account from Google Assistant // You can return an empty body return {}; });
Java
@Override public void onDisconnect( @NotNull DisconnectRequest disconnectRequest, @Nullable Map<?, ?> map) { // TODO Disconnect user account from Google Assistant // This function does not return anything }
Per ulteriori informazioni, consulta la documentazione di riferimento dell'intent DISCONNECT
.