Slide 13
Slide 13 text
Multi-surface
conversationsの
実装方法 【1/4】
app.intent('Today Dog - yes', conv => {
const dogName = conv.data.dogName
if (conv.screen) {
// 画面あるなら、画像を表示する
} else {
const screenAvailable =
conv.available.surfaces.capabilities.has('actions.capability.SCREEN_OUTPUT');
if (screenAvailable) {
// 画面が利用可能なデバイス
(スマホ)に引き継ぐ
const context = '今日のわんこの画像を確認しよう
';
const notification = '今日のわんこ「' + dogName + '」の画像を見よう';
const capabilities = ['actions.capability.SCREEN_OUTPUT'];
conv.ask(new NewSurface({ context, notification, capabilities }));
} else {
// 画像を表示できないので、終了する
}
}
})
Google Home -> Smartphoneに
会話を引き継ぐ