Search code examples
iossendgridicalendar

iPhone unable to open ICS attachment


I don't have my own iPhone, so I have to rely on my QA tester, but they report that when they send an email with ICS attachment to their iPhone, "Preview isn't available and no option to open or download".

Here's the body of the ICS:

BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:-//github.com/rianjs/ical.net//NONSGML ical.net 4.0//EN
VERSION:2.0
BEGIN:VEVENT
DTEND:20240309T150000Z
DTSTAMP:20240308T190720Z
DTSTART:20240309T160000Z
LOCATION:https://portal11.example.com/MiscProgramNameGoesHere
SEQUENCE:1
SUMMARY:MiscProgramNameGoesHere
UID:152339
URL:https://portal11.example.com/MiscProgramNameGoesHere
X-ALT-DESC;FMTTYPE=text/html:\nThank you for registering for the program: 
 MiscProgramNameGoesHere.  <br/>\nThe presentation details are listed below: <
 br/>\nDate: 3/9/2024 <br/>\nTime: 10:00 AM ET <br/>\nDay of Program Login
 : https://portal11.example.com/MiscProgramNameGoesHere <br/>\n<br/>\nPrior to a
 ttending please test your connection at https://help.example.com   <br/>\n<
 br/>\nIf you need Technical Support please email [email protected]     <b
 r/>\n<br/>\n
END:VEVENT
END:VCALENDAR

the email is being sent via SendGrid.


Solution

  • I was getting this error on an iPhone because of a bug that I was not able to notice myself. I had accidentally switched the Start Time and the End Time, as you can see in the ICS Text.

    DTEND:20240309T150000Z
    DTSTART:20240309T160000Z
    

    Here you can see, the Start Time is 16:00 and the End Time is 15:00. Surprisingly, MS-Outlook running in a Windows environment and MS-Outlook running on an Android were both able to import the ICS file and simply flip the Start and End Times, but MS-Outlook running on an iPhone generated an error with this ICS file.