gpt4 book ai didi

php - php 中的 Google 日历推送通知监视命令

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:44:35 26 4
gpt4 key购买 nike

我正在使用 php watch 命令:

$service = new Google_Service_Calendar($client);


$channel = new Google_Service_Calendar_Channel($client);
$channel->setId('20fdedbf0-a845-11e3-1515e2-0800200c9a6689111');
$channel->setType('web_hook');
$channel->setAddress('https://www.exampel.com/app/notification');

$watchEvent = $service->events->watch('primary', $channel);

此命令运行良好,我得到响应:

Google_Service_Calendar_Channel Object ( [address] => [expiration] => 1401960485000 [id] => 20fdedbf0-a845-11e3-1515e2-0800200c9a6689111 [kind] => api#channel [params] => [payload] => [resourceId] => HZjSdbhwcd5KMKEA3ATA31LoR-w [resourceUri] => https://www.googleapis.com/calendar/v3/calendars/primary/events?key=AIzaSyBl_Y7Y4eQDve-0DjwzBEP7_qOLo-67ouY&alt=json [token] => [type] => [modelData:protected] => Array ( ) [processed:protected] => Array ( ) ) 

但是;在我设置的网址中,当我的日历发生变化时,我不会收到任何消息。我错过了什么吗!?

最佳答案

我有一个类似的问题,这是由我的应用程序上的身份验证引起的。

尝试向 https://www.exampel.com/app/notification 发送 post 请求并查看是否收到。如果不是,请仔细检查您的路由或身份验证。

关于php - php 中的 Google 日历推送通知监视命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23930262/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com