问题描述
在Google驱动器中编辑文件后,我无法获得推送通知。
使用过的库: googleapis , google-auth-library 。
有渠道:
drive.changes.watch({
pageToken:tokenId,
资源:{
id:uuid.v1(),
类型:'web_hook',
地址:'https://7def94f6.ngrok.io/notifications'
$ b},函数(err,result,message){
console.log(err,result);
});
终端结果
当我尝试使用试试看!时in google-drive api
他,我之前告诉过你,我对Drive Api一无所知。但我想我得到了这个。查看您上面插入的控制台日志。你有没有叫:
开始标记:6178
然后在提交的文件中出现这样的错误:
这个(box)应该设置为来自前一个响应或的nextPageToken 构成getStartPageToken方法(字符串)
我没有得到你的问题,你是在哪里得到你想要放在那个盒子里的 2234 Token ?我想你正在使用nextPageToken方法?但仍然假定系统从零开始,你没有任何以前的响应=>所以你不能在该框中有另一个标记,但是 start token from console ..
所以现在我的建议是 2234 放入开始标记: 6178 。
注意:我对此可能是错误的。因为这个问题意味着另一个问题,它应该是一个评论,但我没有足够的经验来添加一个。希望能以某种方式帮助你。
I can't get push notifications, after editing files in google drive.
Used libraries: googleapis, google-auth-library.
There is channel:
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); });
The result in terminal
When I try to use "Try it!" in google-drive api
I get this error (on screenshot you can see my parameters)
HE he, as I told you before i don't know anything about Drive api. But I think i got this. Look in your console log that you inserted above. You have smth called:
Start Token: 6178
Then on the filed you have the error it says:
"This (box) should be set to a value of the nextPageToken from the previous response or form the getStartPageToken method (string)"
What i do not get form your question, is where do you got your 2234 Token that you want to put in that box? I guess you are using the nextPageToken method? But still assuming that the system starts form scratch, you do not have any "previous response" => so you can't have another token in that box, but the start token from console..
So for now, my suggestion is instead 2234 put the start token: 6178.
Note: I could be dead wrong about this. Because this question implies another question, it should be a comment but i don't have enough experience to add one. Hope that helped you somehow.
这篇关于谷歌驱动器无法获得推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!