Google日历推送通知点击过多

时间:2019-06-30 14:00:27

标签: node.js google-api google-calendar-api

const jwtClient = new google.auth.JWT(
      privatekey.client_email,
      null,
      privatekey.private_key,
      ['https://www.googleapis.com/auth/calendar']);



//authenticate request
jwtClient.authorize(function (err, tokens) {
  if (err) {
  console.log(err);
  return;
  } else {
  console.log("Successfully connected!");
  }
});

const activatePushNotification = function(calendarID) {
    calendar.events.watch({
    auth: jwtClient,
    calendarId: calendarID, 
    singleEvents: true,
    orderBy: 'startTime',
    resource: {
      "id": uuid.v1(),
      "type": 'web_hook',
      "address": 'https://example.com/notification'
    }
    }, (err, test) => {
    console.log(err, test, '<------------------->');
    })
}

我正在使用上面的example代码来向我的域激活推送通知,每当我changeadd new event到该日历时,它就应该将通知推送到我的域,但是目前我正面临着推送通知问题多次击中了我的域,大约400 above times左右。请帮助我解决这个问题。

0 个答案:

没有答案