我有一个用例,其中我需要使用ActionOnSDK在Google Assistant中发送自定义数据和推送通知,如何向有任何线索的人发送自定义数据?
let notification = {
userNotification: {
title: 'A new tip is added',
},
target: {
userId: 'abcd1234-EFGH_789',
intent: 'tell_latest_tip',
// Expects a IETF BCP-47 language code (i.e. en-US)
locale: 'en-US'
},
};
request.post('https://actions.googleapis.com/v2/conversations:send', {
'auth': {
'bearer': tokens.access_token,
},
'json': true,
'body': {
'customPushMessage': notification
}
};