首页 > 解决方案 > 我如何发送自定义数据和推送通知?

问题描述

我有一个用例,我需要在 Google Assistant 中使用 ActionOnSDK 发送自定义数据和推送通知,我如何发送它任何人有任何线索?

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
    }
};

标签: dialogflow-esactions-on-googlegoogle-assistant-sdk

解决方案


推荐阅读