【问题标题】:google-drive can't get push notificationsgoogle-drive 收不到推送通知
【发布时间】:2016-07-31 09:55:21
【问题描述】:

在 Google Drive 中编辑文件后,我无法收到推送通知。
使用的库:googleapisgoogle-auth-library
有频道:

drive.changes.watch({
    pageToken: tokenId,
    resource: {
        id: uuid.v1(),
        type: 'web_hook',
        address: 'https://7def94f6.ngrok.io/notifications'
    }
}, function(err, result, message) {
    console.log(err, result);    
});

终端中的结果

当我尝试使用“试试看!”时在 google-drive api中

I get this error (on screenshot you can see my parameters)

【问题讨论】:

    标签: node.js push-notification google-drive-api


    【解决方案1】:

    他,正如我之前告诉过你的,我对 Drive api 一无所知。但我想我明白了。查看您在上面插入的console log。你打了个电话:

    Start Token: 6178
    

    然后在文件上你会看到错误:

    "此(框)应设置为 nextPageToken from the previous responseform the getStartPageToken method(字符串)的值"

    我没有从你的问题中得到什么,你从哪里得到你想放在那个盒子里的2234 Token?我猜你正在使用 nextPageToken 方法?但是仍然假设系统从头开始,你没有任何“previous response”=>所以你不能在那个盒子里有另一个令牌,但是来自控制台的start token..

    所以现在,我的建议是 2234 放置开始令牌:6178

    注意:我对此可能大错特错。因为这个问题暗示了另一个问题,所以它应该是一个评论,但我没有足够的经验来添加一个。希望对您有所帮助。

    【讨论】:

    • 谢谢,阿隆!我认为我的参数有问题。
    • 谢谢,阿隆!你的帖子帮助了我。我有令牌错误。
    猜你喜欢
    • 2017-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-29
    • 2019-03-07
    • 1970-01-01
    相关资源
    最近更新 更多