我需要向 Google Nest Hub 发送推送通知。 我按照谷歌的文档:https://developers.google.com/assistant/engagement/notifications
问题是我可以向智能手机发送通知,但不能向智能显示屏发送通知。
const request = require('request');
const {google} = require('googleapis');
const key = require("./Jessa Assistent-730a994db178.json");
const jwtClient = new google.auth.JWT(
key.client_email, null, key.private_key,
['https://www.googleapis.com/auth/actions.fulfillment.conversation'],
null
);
jwtClient.authorize((err, tokens) => {
if (!err) {
request.post('https://actions.googleapis.com/v2/conversations:send', {
auth: {
bearer: tokens.access_token,
},
json: true,
body: {
customPushMessage: {
userNotification: {
title: 'Push Notification Title',
},
target: {
userId: '<User_ID> (Took this part out of this example)',
intent: 'High Priority Vragen',
locale: 'nl-NL'
},
},
isInSandbox: true,
},
}, (err, httpResponse, body) => {
console.log(`${httpResponse.statusCode}: ${httpResponse.statusMessage}`);
});
}
});
最佳答案
智能显示屏不支持通知。
关于javascript - 无法向 Google 智能显示屏发送推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58955322/