Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Can't get google calendar to subscribe to DDay.iCal feed

$
0
0

I keep getting the error "Cannot fetch Url" when I try to Add my iCal feed by url to google calendar. I created a handler (.ashx) in c# using the DDay.iCal nuget package. It returns a string of data. It works in Outlook and I have validated it using a few different ical validators. I searched through a forums and had to escape commas and some other settings but I am not able to get google calendar working.

Example return when you view the source

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
PRODID:-// iCalendar Feed
BEGIN:VEVENT
CATEGORIES:iSchedule - Flights
CLASS:PUBLIC
CREATED:20130820T202200
DESCRIPTION:SEATTLE-TACOMA\ INTL\ \(KSEA\)\ SEATTLE\n\ Local:\ 9/21/2013\ 1
 :00:00\ PM\ \ Zulu:\ 9/21/2013\ 8:00:00\ PM\ \n\nSAN\ DIEGO\ INTL\ \(KSAN\
 )\ SAN\ DIEGO\n\ Local:\ 9/21/2013\ 6:54:00\ PM\ \ Zulu:\ 9/22/2013\ 1:54:
 00\ AM\ \n\nClick\ below\ to\ view\ trip\ sheet\ \nhttps://docs\.avianis\.
 com/Dev/rdProcess\.aspx\?rdProcess=GetDocument&rdTaskID=PrintItinerary&Rep
 Config=Trip\.TripSheet_Gray&IsCrew=1&IsCrew=1&ReportID=2680f881-8466-42ed-
 9ddb-e2a2fbe3ec49
DTEND:20130922T015400Z
DTSTAMP:20130921T200000Z
DTSTART:20130921T200000Z
LAST-MODIFIED:20130820T202200
LOCATION:SEATTLE-TACOMA INTL (KSEA)
PRIORITY:1
SEQUENCE:0
STATUS:Confirmed
SUMMARY:Trip 320 Leg 1
TRANSP:Opaque
UID:122686
X-ALT-DESC;FMTTYPE=text/html:<p style="font-weight:bold\;">SEATTLE-TACOMA I
 NTL (KSEA) SEATTLE<br /> Local: 9/21/2013 1:00:00 PM  Zulu: 9/21/2013 8:00
 :00 PM</p><p style="font-weight:bold\;">SAN DIEGO INTL (KSAN) SAN DIEGO<br
  /> Local: 9/21/2013 6:54:00 PM  Zulu: 9/22/2013 1:54:00 AM</p><p><a href="https://docs.avianis.com/Dev/rdProcess.aspx?rdProcess=GetDocument&rdTaskI
 D=PrintItinerary&RepConfig=Trip.TripSheet_Gray&IsCrew=1&IsCrew=1&ReportID=
 2680f881-8466-42ed-9ddb-e2a2fbe3ec49">Click below to view trip sheet</a></
 p>
END:VEVENT
END:VCALENDAR

Here is the code I'm using to generate the event above.

DateTime aDate = Convert.ToDateTime(reader["ArrivalDateUTC"].ToString());
DateTime dDate = Convert.ToDateTime(reader["DepartureDateUTC"].ToString());
iCalDateTime end = new iCalDateTime(aDate.Year, aDate.Month, aDate.Day, aDate.Hour, aDate.Minute, aDate.Second);
iCalDateTime start = new iCalDateTime(dDate.Year, dDate.Month, dDate.Day, dDate.Hour, dDate.Minute, dDate.Second);

Event evt = cal.Create<Event>();
evt.Priority = 1;
evt.DTEnd = end;
evt.DTStart = start;
evt.DTStamp = start;
evt.IsAllDay = false;
evt.DTEnd.IsUniversalTime = true;
evt.DTStart.IsUniversalTime = true;
evt.Created = iCalDateTime.Now;
evt.LastModified = iCalDateTime.Now;                                                
evt.Class = "PUBLIC";
evt.Status = EventStatus.Confirmed;

List<string> categories = new List<string>();
categories.Add("iSchedule - Flights");
evt.Categories = categories;

DDay.iCal.CalendarProperty htmlProp = new CalendarProperty("X-ALT-DESC", html.ToString());
htmlProp.AddParameter("FMTTYPE", "text/html");
evt.Properties.Add(htmlProp);

evt.Description = Regex.Escape(description.ToString()).Replace(",", "\\,");
evt.UID = reader["FlightLegID"].ToString();
evt.Transparency = TransparencyType.Opaque;
evt.Location = reader["DepartureName"].ToString() + " (" + reader["DepartureId"].ToString() + ")";
evt.Summary = "Trip " + reader["Number"].ToString() + " Leg " + reader["FlightLegNumber"].ToString();

Any help would be greatly appreciated.




Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>