Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exposing calendar as an iCal with subscribe option in PHP

I have an application in PHP where each user has his associated events.

What I want to do is to expose his events under in a way similar to events on facebook which gives urls in format webcal://www.facebook.com/ical/b.php?uid=123456789&key=ASD123ASD123ASD and whenever there's a new event, it automatically gets propagated to my calendar which I have added to my google calendar.

What I want to do is expose this calendar on a url such as http://whatever.org/someLongUniquePerUserIdentifier.ics.

I tried to simulate the event generation script with a simple file that was at the same url. It was an ics file that was consumed by google, the events have been added, but when I changed the file contents (deleted an event) = altered the resource, to which google calendar should be subscribed, the change simply didn't go through to gcal.

As I was unable to find any reliable source of documentation, I tried to google a lot with different keywords and I was only guided to webdav servers like DAVical, sabredav, etc.

I have installed DAVical on my server only to getting to a state where I have the server properly installed but no idea how to expose the events from my MySQL database on my desired url, which would the clients subscribe to.

Same with sabredav, except for the fact, that I haven't tried getting it to work, because I can't see any documented way of getting my events out to the world using any of the dav server.

I am basically stuck in a place where I have working ics export in PHP which is not getting asked for updates by calendar clients, and a running CalDAV server which might be asked by clients for updates, but has no data to return.

Any thoughts?

EDITED QUESTION:

What is the right way to achieve instant one-way calendar sync?

like image 950
Elwhis Avatar asked Apr 21 '14 22:04

Elwhis


People also ask

How do I subscribe to a iCal feed?

Apple iCalOpen the iCal application. Select the Calendar menu and then select "Subscribe". Paste the copied URL into the Calendar URL field. Click Subscribe to load the feed into your calendar.


1 Answers

If I am not mistaken, it seems that you simply need to change your link from http://whatever.org/someLongUniquePerUserIdentifier.ics to webcal://whatever.org/someLongUniquePerUserIdentifier.ics

The webcal protocol is supposed to trigger the "subscribe" action in your calendar software. If you are seeing it download a file then it's not subscribing.

like image 179
jessica Avatar answered Oct 12 '22 12:10

jessica