Following the design tips on action-on-google developer platform, I'm trying to give a custom welcome response for users who come back in a Google Assistant Voice app. https://developers.google.com/actions/design/tips
To proceed, i started by switch My Default Welcome intent in Dialogflow in the Fullfilment mode. Then deploy my code on firebase. It's work well when i ask for a name permission, but when I try to input the 'AppRequest.User lastSeen', my app shut down? Maybe you know what i missed in my code?
'use strict';
const {
dialogflow,
Permission,
} = require('actions-on-google');
const functions = require('firebase-functions');
const app = dialogflow({debug: true});
app.intent('Default Welcome Intent', (conv) => {
const welcome = (conv) => {
if (conv.user.last.seen) {
conv.ask(`Hey you're back...`);
} else {
conv.ask('Welcome to World Cities Trivia!...');
}
}});
// Set the DialogflowApp object to handle the HTTPS POST request.
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);