doudou1309 2017-06-14 08:02
浏览 19

Google日历推送通知不会在删除时通知

I have registered push notifications. Updates and creations work just fine, but I am not able to receive deleted events.

I am setting the channel like this

    public function setUpPushNotificationsChannel($lengthHours = 168){
        $this->cancelPushNotificationsChannel();
        $channel = new Google_Service_Calendar_Channel();
        $channel->setId(create_guid());
        $channel->setType('web_hook');
        $channel->setAddress( $this->url);
        $channel->setToken(Utils::encrypt($this->pushSecret);
        $dateTime = new DateTime();
        $dateTime->add(date_interval_create_from_date_string("$lengthHours hours"));
        //timestamp is in milliseconds for google -.-
        $channel->setExpiration($dateTime->getTimestamp() * 1000);
        //this does not do anything
        $optParams = array(
            'singleEvents' => true,
            'showDeleted' =>true,
        );
        $channel = $this->service->events->watch($this->getGoogleCalendarId(),$channel,$optParams);
        $this->gcalendarSetting->gcalendar_push_channel_id_c = $channel->getId();
        $this->gcalendarSetting->gcalendar_resource_id_c = $channel->getResourceId();
        $this->gcalendarSetting->save();
    }

I could not find anything in the google doc, maybe I am missing some parameter for deleted events? Thanks

  • 写回答

1条回答 默认 最新

  • dtd14883 2017-06-14 08:23
    关注

    It turns out, that the problem is not in deleted events, but in everything. The notifications just quite often don't arrive and I just had bad luck while I was testing it. It seems that almost 50% of changes are not pushed, which is quite unsatisfying.

    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集