actions-on-googledialogflow-esgoogle-homeproactive

notification(daily update) is not working on google home mini device


i created an app on dialogflow and deployed on google assistant, it is working fine on both mobile assistant and google home, but the notification(daily update) is not working on google home mini device well daily update working really fine in mobile device, and i didnt use any rich response like card and other thing which mini device doesnt support, then what is the possible reason? Currently it is deployed home-notification-6b314 same google app is used for deployment of firebase function(as webhook), dialogflow app and and action on google

what should i do?

here is some code which i write on my webhook for reference:

// process.env.DEBUG = 'actions-on-google:*';
import * as functions from 'firebase-functions';
const { DialogflowApp } = require('actions-on-google');

const Actions = {
  UNRECOGNIZED_DEEP_LINK: 'deeplink.unknown',
  FINISH_UPDATE_SETUP: 'finish.update.setup',
};
const Parameters = {
  CATEGORY: 'category',
  UPDATE_INTENT: 'UPDATE_INTENT'
};

const DAILY_NOTIFICATION_ASKED = 'daily_notification_asked';
const PUSH_NOTIFICATION_ASKED = 'push_notification_asked';

export const webhook = functions.https.onRequest((request, response) => {
  try {
    const app = new DialogflowApp({ request, response });

    console.log('Request headers: ' + JSON.stringify(request.headers));
    console.log('Request body: ' + JSON.stringify(request.body));

    // Map of action from Dialogflow to handling function
    const actionMap = new Map();

    actionMap.set(app.StandardIntents.CONFIGURE_UPDATES, configureUpdates);
    actionMap.set(Actions.FINISH_UPDATE_SETUP, finishUpdateSetup);

    actionMap.set("welcome", welcome);
    actionMap.set("whatMissed", whatMissed);
    actionMap.set("what_did_i_missed.what_did_i_missed-yes", whatMissed_yes);

    app.handleRequest(actionMap);

  } catch (e) {
    console.log("catch error: ", e)
  }
});



function welcome(app) {

  app.ask(app.buildRichResponse()
    .addSimpleResponse({
      speech:
        `<speak>
            <s> Hi, I'm you medication assistant </s>
        </speak>`
    })
  )
}

// Start opt-in flow for daily updates
function configureUpdates(app) {
  console.log("====>> configure triggered1")

  const intent = app.getArgument('UPDATE_INTENT');
  console.log("#####  INTENT: ", intent);

  const category = app.getArgument('notification-category');
  console.log("#####  category: ", category);

  app.askToRegisterDailyUpdate(
    'what_did_i_missed',
    [{ name: "some name", textValue: "some text" }]
  );
}

// Confirm outcome of opt-in for daily updates.
function finishUpdateSetup(app) {
  console.log("====>> finish triggered")

  if (app.isUpdateRegistered()) {
    app.tell("Ok, I'll start giving you notification that time.");
  } else {
    app.tell("something went wrong when i was scheduling up notification");
  }
}



// # NOTE
// must have to enable notification 2 places, 
// - first in google action dashboard(overview>Action discovery and updates>{intent-name}>Enable User updates and notifications>set title of notification) 
// - second in google cloud console(Firebase Cloud Messaging API), 
// otherwise i will just keep saying '{your app name} is not responding'



function whatMissed(app) {

  const status = app.getArgument("boolean");
  if (status === 'yes') {
    app.tell("Ok, good job. keep it up!");
  } else {
    app.ask("would you like me to remind you again?");
  }

}

function whatMissed_yes(app) {

  app.askToRegisterDailyUpdate(
    'what_did_i_missed',
    [{ name: "some name", textValue: "some text" }]
  );
}

Solution

  • "In this first iteration updates are system notifications on the user's Assistant-enabled phones, but we plan to expand to new surfaces." https://developers.google.com/actions/assistant/updates/overview

    Support person is also saying it is only supported in mobile device, and not in other surfaces like google home and mini.