本文介绍了PHP中的Google Calendar Push Notification监视命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用php watch命令:

I am using the php watch commant:

$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);

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

This command works fine and I get the response:

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 ( ) )

但是;在我的设置网址中,当日历中发生某些更改时,我没有收到任何消息.我想念什么吗??

However; In my set up url I don't get any message when something changes in my calendar.Am I missing something!?

推荐答案

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

I had a similar issue which was caused by authentication on my application.

尝试将发帖请求发送到https://www.exampel.com/app/notification,然后查看是否已收到.如果没有,请仔细检查您的路由或身份验证.

Try sending a post request to https://www.exampel.com/app/notification and see if it is received. If not, double check your routing or authentication.

这篇关于PHP中的Google Calendar Push Notification监视命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 19:18