Accept or Decline Apple Calendar Event (.ics) - ios

I have a PHP script I've setup to generate an .ics file and email it to a person. The generated ics file works as intended in Microsoft Outlook 2010 but not on iOS devices. When the calendar event is launched in Outlook, the user is asked whether to accept or decline the event however when the user launches the same ics file on their iPhone, iOS only offers them to "Add to Calendar."
How can I force or make iOS ask the user to accept or decline the event?
Here's my mocked up ics file:
BEGIN:VCALENDAR
METHOD:REQUEST
VERSION:2.0
PRODID:-//TEST INC//TEST//EN
BEGIN:VEVENT
DTSTAMP:1402101843
SEQUENCE:0
UID:539236231203d
ORGANIZER:MAILTO:test#blahblah.com
ATTENDEE;RSVP=TRUE:mailto:test#blahblah.com
DTSTART;VALUE=DATE:20140612
DTEND;VALUE=DATE:20140613
CATEGORIES:MEETING
CLASS:PUBLIC
SUMMARY:Meeting Test
DESCRIPTION:Test
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 3.2//EN"">
<html><body><b>Test</b>
</body></html>
END:VEVENT
END:VCALENDAR
I guess I'm missing something in my ics file to communicate with Apple's standards?
I looked over at iCalendar .ics accept/decline on iOS but no solution was found.
Thanks!

I had this same issue (Outlook has Accept/Decline but iOS doesn't) and was able to fix it by adding the ORGANIZER line. It appears your syntax may be wrong. You have a colon after ORGANIZER instead of a semicolon. You may also need to fix the capitalization of mailto (should be MAILTO) in the ATTENDEE line.

Related

CalDAV: Where is the URL Component for iOS?

On iOS, you can create reminders with a URL (https://www.example.com/example.php?key=value) attacted to it (open any web page, open share dialog, tap reminders app).
It syncs correctly between devices (with the full URL), however on my CalDAV server, the To-Do is stored as
BEGIN:VCALENDAR
PRODID:Open-Xchange
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VTODO
DTSTAMP:20200622T134803Z
SUMMARY:Example Reminder
DESCRIPTION:www.example.com
CLASS:PUBLIC
STATUS:NEEDS-ACTION
UID:A0F91D70-6F05-4D91-934A-7E7990B873D5
CREATED:20200622T134404Z
LAST-MODIFIED:20200622T134738Z
END:VTODO
END:VCALENDAR
meaning there is no component to store the full URL (the description is only the host and doesn't contain the full request URL).
How can I include the URL so that iOS understands it when creating reminders on the server side?
RFC 5545 has an URL: component that iOS doesn't interpret.

Add Calendar Event via Promotional Email onGoogle and iCal

In a promotional email, I have added links to create an event on Google Calendar and iCal (iOS calendar). I found out that I can create the Google Calendar event using the following URL format
http://www.google.com/calendar/event?action=TEMPLATE&dates=20200515T000000Z/20200515T010000Z&location=My_Location&trp=false&text=Event_Title&details=Event_Details
Is there a way to create the Calendar event on iCal or iCloud using a URL and passing data via query string parameters?
As #jescanellas mentioned, I don't think that's possible, but you can send an .ics file containing info for that event in an email. Upon clicking on the file it'd be added to users iOs Calendar.
Example event:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:19970610T172345Z-AF23B2#example.com
DTSTAMP:19970610T172345Z
DTSTART:19970714T170000Z
DTEND:19970715T040000Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
You can find more about it here RFC 5545.

How do I determine that a link is a calendar event from an IOS App and then add it to Calendar?

I have written an iPhone App that looks at a webpage. (I have authorized the App to access Calendar.) One of the links is a calendar link. When I look at that link with Safari, I get a message.
https://www.dropbox.com/s/opzhxcrg8ye2z4v/Screen%20Shot%202018-11-23%20at%201.17.15%20PM.png?dl=0
"The website is trying to show you a calendar invite. Do you want to allow it ...". I can then add it to my calendar. However, when I open that identical link inside my app, my app does not recognize it is a calendar link and then I get options to either Open, Add to Read List, copy ...".
https://www.dropbox.com/s/wd7n8n9bz764wih/Screenshot%202018-11-23%2013.20.53.png?dl=0
My question is how to get my App to recognize that a link is a calendar link?
One determines what should be in the file by the suffix and the MIME content type.
For icalendars, the suffix is .ics and the MIME content type is text/calendar. If a link does not have .ics suffix your app can ignore it, if it has a .ics, then it should check the header for the mime-type.
What is a MIME type?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
What a browser or device actually does with the file depends on what the user has set in the settings. EG: a .pdf will topen in the way that the user has told the browser to open .pdf's - either in browser or adobe reader.
EG in windows for development purposes, I have specified that calendar links (links with suffix .ics) should be opened in my editor rather than my calendar.

How do I get mailto links in iOS (safari) to open the Outlook app?

I've noticed that on iPhone users who are using the Outlook app and do not have the native mail app configured, that when they click on mailto links it prompts them to create a new email account in iOS, instead of opening the Outlook app.
Is there anyway to have Outlook set as the default for mailto links on the iPhone?
iOS doesn't currently support changing the default apps used for composing email and the like.
Instead of 'mailto:' protocol you can use below protocol to open outlook app
ms-outlook://compose?to=joe#example.com&subject=Hello
Duplicate, Already solved here: https://stackoverflow.com/a/33812714/1360730
To test try typing
ms-outlook://compose?to=a#a.com&subject=aaaa in the address bar on safari and see whether the outlook app opens up.
So your href would look something like,
<a href="ms-outlook://compose?to=a#a.com&subject=aaaa"/>
From the upcoming iOS 14 on, this will be an option that users can set.
Set default email and browser apps.
With iOS 14, you can set a third‑party app as the default email or browser app systemwide.
Source: https://www.apple.com/ios/ios-14-preview/

UIDocumentInteractionController handling ics files

I've managed to open an ics file stored locally, and the UIDocumentInteractionController recognizes it the UTI as com.apple.ical.ics (which is expected). The data displays as I was hoping, for the most part:
I was under the impression from the docs that UIDocumentInteractionController would automatically recognize this ics file type and give some calendar-related options, however, there doesn't seem to be any way for me to add these events to my calendar from this view. Under the "Open in" menu, I see mail and dropbox as options, but not Calendar. If I email it to myself, I then can add the events from the mail app. Am I missing something with how this view works? Mobile Safari handles ics files in a similar way, except there will be an "Add all" button in the title bar. That's exactly how I thought this would behave. I'd prefer not to use EventKit at this point, since I'd just like it to mimic how safari handles the file.

Resources