当我需要发送卡片中的信息时,我正在使用 google nodejs 库上的操作来使用askForNewSurface 切换到带屏幕的设备。
我的问题是,askForNewSurface 似乎运行成功,但对话从未切换到其他设备。
这种情况在 Google 模拟器和实际的 Google Home 设备上的操作中都会发生,设备表示它们将切换并结束对话,但之后没有任何反应。
这是我用来提示切换的代码:
const hasScreen = app.hasAvailableSurfaceCapabilities(app.SurfaceCapabilities.SCREEN_OUTPUT);
if (hasScreen) {
app.data.newSurfaceTransfer = cardData;
app.askForNewSurface(cardData.sendToScreenMessage, cardData.sendToScreenContext, [app.SurfaceCapabilities.SCREEN_OUTPUT]);
}
我知道 this post我不认为它适用于我的情况,因为我正在用英语(美国)测试它。
这些是我的依赖版本
"@types/node": "^9.3.0",
"actions-on-google": "^1.7.0",
"body-parser": "^1.18.2",
"dotenv": "^4.0.0",
"express": "^4.16.2",
"firebase": "^4.8.1",
"nodemon": "^1.14.10",
"request": "^2.81.0",
"rx-http-request": "^1.2.0",
"rxjs": "^5.5.6"
预先感谢您的任何帮助或指导!
最佳答案
关于node.js - Google 上的 Actions AskForNewSurface 未切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48172336/