小编Ide*_*ija的帖子

PHP中的Google Calendar Push Notification监视命令

我正在使用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);
Run Code Online (Sandbox Code Playgroud)

这个命令工作正常,我得到响应:

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 ( ) ) 
Run Code Online (Sandbox Code Playgroud)

然而; 在我的设置网址中,当日历中发生某些更改时,我没有收到任何消息。我错过了什么吗?

php google-api-php-client

6
推荐指数
1
解决办法
2365
查看次数

标签 统计

google-api-php-client ×1

php ×1