Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Calendar sync with php in 2 ways

I am creating a php website that uses the Google Calendar API. It's working fine with Create, Update and Delete: any event from the PHP website goes into my Google Calendar events after login.

Events created on my site are created in Google Calendar.

What I want now that is: when I create an event from my test page it goes into Google Calendar after login, then if I update or delete that event from Google Calendar then it should automatically update or delete the php website event.

Basically: 1-way sync is working fine but now I want 2-way synchronization.

If anybody has any ideas then kindly share with me, it will be much appreciated.

like image 393
user563860 Avatar asked Jan 05 '11 12:01

user563860


1 Answers

There are no application hooks in Google Calendar (gCal) that allow you to trigger an action when an event is deleted. Instead you must either poll gCal at intervals (this could be a cron job every few minutes/hours) and update your calendar accordingly, or any time you perform an action from your calendar have a 1 in X possibly of a full re-sync.

This implies that you are using the gCal as the definitive source, and mirroring those changes back to your local application.

like image 155
Andy Avatar answered Sep 23 '22 04:09

Andy