Reputation: 7966
I have created an ICalendar file with multiple(10) events. The file validates correctly here and here.
It also opens correctly in the Calendar application on OSX.
In Gmail, the first event is shown correctly with an option to add to calendar, but the other events do not appear. If I choose to add the event, it adds correctly.
If I attempt to import the file to Google Calendar, it says that 3 events have been imported, but nothing shows.
Any suggestions please?
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//MY-ID//session-schedule//EN
METHOD:PUBLISH
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 1
DTSTART:20150701T150000Z
DURATION:PT45M
LOCATION:Cape Town\, Western Cape\, South Africa
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 2
DTSTART:20150708T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 3
DTSTART:20150715T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 4
DTSTART:20150722T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 5
DTSTART:20150729T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 6
DTSTART:20150805T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 7
DTSTART:20150812T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 8
DTSTART:20150819T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 9
DTSTART:20150826T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150630T131326Z
UID:[email protected]
SUMMARY:Session 10
DTSTART:20150902T150000Z
DURATION:PT45M
STATUS:CONFIRMED
ORGANIZER;CN=Joe Soap:MAILTO:[email protected]
ATTENDEE:CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Fred Bloggs:MAILTO:[email protected]
END:VEVENT
END:VCALENDAR
Upvotes: 12
Views: 3317
Reputation: 71
If you have more then one event, you have to seprate them on at liesst 2 files ics,and it will work .
Upvotes: 1
Reputation: 101
Helpful link in case someone is still reading this - the most recent answer coming from a Product Expert at GCalToolkit:
In short, Google Calendar has intentionally torpedoed this legitimate RFC 5545 feature, in light of "recent spamming concerns".
They have locked the thread, therefore blocking off any comments that would ask how does this make any sense?
Why do people who have legitimate reasons to publish a "programme" that occupies different timespans on five consecutive days, need to break down five separate .ics files? Why wouldn't GMail just raise an extra prompt "This will add 5 events to your calendar. Are you sure?" if they're concerned about spammers? Why is sending five .ics files instead of one, "less spammy"?
Thus we can't just send the single .ics which says "this is our 5-day programme", which is perfectly well accepted by Apple, by Microsoft and by Google Calendar itself if you actually go into its Settings -> Import, rather than trying to add to it "from GMail". Whereas if something is a spam, then adding even that first event is adding one more event than should be added. And that's where confirmation prompts come in.
Anyway, not to preach to the choir... the above is the link if you wished for a clarification from GCalToolkit experts themselves.
Upvotes: 4
Reputation: 188
Probably there is nothing wrong with the ics file. I am assuming that you are trying to mail this ics file to a gmail account. It looks something like this in your gmail ID. And when you try to "Add to Calendar" link it adds only 1 event to the calendar.
I think gmail is programmed to read only the first event in the ics file. Try to import the ics file by opening google calendar settings and selecting "Import & export". This should add all the events to your calendar.
But I guess you would not want to instruct the user to open calendar setting. Strangely I tried sending 2 ics files in the mail. One with 2 event and another with 1 event. In this case it read all 3 events and allowed me to add it to my calendar. So I guess the workaround it to either send multiple ics file and send all event. Or at least create 2 ics file where 1 can act as a dummy and other can have all the events.
Upvotes: 3
Reputation: 1676
I've been struggling with this same issue and have some discoveries to report, but not a solid solution yet...
When the .ics attachment has a mime_type
of application/ics
then gmail shows all events in a grey 'Events in this message' box like this - screenshot 1.
However, with a mime_type
of text/calendar
it shows the slicker gmail event box like this - screenshot 2.
The slicker option can't show multiple events so I'm setting the mime_type depending to the number of events in the .ics
The problem I still have is that gmail seems to only show the grey multiple events box sporadically but I can't work out a pattern! Anyone know why?
Upvotes: 6
Reputation: 71
I cant tell if you properly encoded the lines as separate properties or not. The iCalendar you provided looks ok on a quick pass except for 2 things:
1: You do not have a CRLF at the end of every property. That may simply be how you posted the iCalendar and you actually do have a CRLF at the end of every line.
2: You included ATTENDEEs on a METHOD:PUBLISH but that is not allowed by RFC 2446.
You should also include a SEQUENCE property to make updating work properly however leaving it off is ok if its the first version.
Have you tried simply importing one at a time to see if that works?
Upvotes: 0