Cancelling an iPhone calendar event from an ics email attachment - iphone

I'm creating an email that contains a VCalendar event in it's body. This displays as an ics attachment in the email of my iPhone 4 (IOS v5.1.1 9B206).
I can open this attachment and add the event to my iPhone calendar by clicking the "Add to Calendar" button.
Now, I'm trying to cancel events the same way.
I'm generating the same UID as the original event (based on the date and time of the event), setting Method to CANCEL and Status to CANCELLED (as recommended), however, although I can see the ics attachment in the email, I cannot open the attachment on my iPhone.
ics being sent:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//mycompany.com//test
METHOD:CANCEL
BEGIN:VEVENT
CLASS:PRIVATE
UID:20120924T090000
DTSTAMP:20120923T151052
DTSTART:20120924T090000
DTEND:20120924T130000
LOCATION:Normal
DESCRIPTION:Always a description
STATUS:CANCELLED
SUMMARY:Cancelling
ORGANIZER;CN="Test":mailto:donotreply#test.com
ATTENDEE;CN="Mr Smith":mailto:mr.smith#test.com
PRIORITY:5
SEQUENCE:2
END:VEVENT
END:VCALENDAR
UPDATE:
This actually works on my 1st generation iPad (IOS 5.1.1 9B206), so I'm now thinking it's because my iPhone doesn't have my exchange calendar.
UPDATE 2:
I've eventually managed to get my Exchange calendar syncing to my iPhone by re-entering the name of the email server, this re-validated/refreshed the details and now all my Outlook appointments sync.

Adding and cancelling an appointment on iPhone from an ics email attachment both work as long as everything is set up correctly.
You can add an appointment to any calendar (I was adding them to my local calendar).
You cannot cancel an appointment from a local calendar, I needed to synch my Exchange calendar to my iPhone to allow me to cancel events that I'd added.

Related

.ics File: VALARM for an allday event dosen´t work

I need an ICS-File for a allday event which includes a reminder, one day before the event takes plays.
The ICS-File generates the event without any problem. But the reminder is always set on 18hours, even if the trigger is set on e.g. "-PT15M"....
Can anybody help?
ICS Testfile:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:Karabulut
BEGIN:VEVENT
CATEGORIES:Planing
DTSTART; VALUE=DATE:20200129
SUMMARY: Revenue
METHOD:PUBLISH
CLASS:PUBILC
BEGIN:VCALENDAR
BEGIN:VALARM
TRIGGER:-PT1D
ACTION:DISPLAY
DESCRIPTION:REMINDER
END:VALARM
END:VCALENDAR
END:VEVENT
END:VCALENDAR
This may be the expected behaviour by the receiving application. The 18 hours may be the default set by you or the application.
Many applications do ot let ics files create alarms. I know I would not want the ics file to be creating alarms & notifications for me!
See also
Ical VALARM not registrering and
Sent email with iCal to outlook with valarm reminder and the links in the answers.
The RFC5545 specification See https://www.rfc-editor.org/rfc/rfc5545#page-75 says:
Note: Implementations should carefully consider whether they
accept alarm components from untrusted sources, e.g., when
importing calendar objects from external sources. One
reasonable policy is to always ignore alarm components that the
calendar user has not set herself, or at least ask for
confirmation in such a case.

ics VALARM support across clients

I am wondering about the BEGIN:VALARM value in ics.
I have set an alarm, but Outlook (PC) and Calendar (Mac) seems to ignore the alarm altogether. In eM Client (PC) the alarm is set but cannot be dismissed (pops up again immediately after dismiss)
Is this a known problem with the iCalendar/ics standard?
The format seems to be valid. Are any additional values needed for each client to understand/accept and handle the alert correctly?
I am subscribing to the .ics file via a https:// URL.
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:adamgibbons/ics
METHOD:PUBLISH
X-PUBLISHED-TTL:PT1H
BEGIN:VEVENT
UID:-LovTg9y9HPDCHu8mVnD
SUMMARY:Purjolök
DTSTAMP:20191026T171500Z
DTSTART:20191024T080000Z
DESCRIPTION:En grönsak i lökfamiljen
URL:https://app.myapp.se/r/edit/-LovTg9y9HPDCHu8mVnD
STATUS:CONFIRMED
CATEGORIES:Matlista
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:En grönsak i lökfamiljen
TRIGGER:-PT10M
END:VALARM
DURATION:PT30M
END:VEVENT
END:VCALENDAR
There is most likely nothing wrong with your code and most clients will ignore those alarms by design.
Whether you receive an invitation via email or subscribe to a calendar via http, you don't want the organiser of the meeting/author of the calendar feed to dictate when/if you should be reminded. It is really up to the attendee/subscriber to set their own alarms.
If, on the other hand, you "import" the same ics file, the alarms will be taken into account (the client considers that the stream already belongs to you and that it is a "backup" of your own calendar).

How to add/modify events in Google calendar with ICS file

I'm trying to create an ICS file to add events to a Google calendar via email. In the end, the calendar will be sent to multiple users, from a desktop app. Ideally I'd like to be able to modify the calendar if the events change (just event times, I'm ignoring cancelled events)
Here is my ICS file
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//MY COMPANY//Calendar//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
UID:shift-439-emp-128#mycompany.com
DTSTART:20180604T090000
DTEND:20180604T153000
DTSTAMP:20180519T081800
SUMMARY:Morning shfit
LOCATION:Morning Location
DESCRIPTION:Morning shift
END:VEVENT
BEGIN:VEVENT
UID:shift-446-emp-128#mycompany.com
DTSTART:20180605T153000
DTEND:20180605T233000
DTSTAMP:20180519T081800
SUMMARY:Night shift
LOCATION:
DESCRIPTION:Night
END:VEVENT
END:VCALENDAR
When I email that file to my gmail account, I can see a "Add to Google calendar" button which I can use to add the events to my prinary calendar.
Now, say the events times changed.
Question : How can I create a new ICS file with the new times so that existing events will be modified in google calendar?
I used UIDs for events so that google does not create duplicate entries. But when I email a second ics file with modified events (with uids), the "add to google calendar" button does not appear. If I try to manually import the ics file from google calendar Import feature, then I get this error message
Could not upload your events because you do not have sufficient access on the target calendar.
If I set different UIDs each time, the import process will work but duplicate entries will be created.
I also tried using REQUEST instead of PUBLISH method
Thanks
I was able to get this working with Gmail using the following:
METHOD: set to REQUEST
SEQUENCE: Set to 0 on first request and increment by 1 each time
ATTENDEE: Identify the Gmail user that is receiving the email by email address
Other variations would have non-desirable effects:
Only seeing 1 of the two events
Not updating existing event
Office 365 sends ICS files to Gmail that can be updated so it can be used to reference a commercial implementation. You can see the requests Outlook 365 sends by using "Show Original" in Gmail to retrieve the base64 encoded calendar body. Outlook 365 uses many other fields so it's instructive to examine.
I have a test script in Go using SparkPost so if you have any questions or would like to use it, just let me know. SparkPost has a free tier but you still need to configure your outbound sending domain to use it.
Here is an example modified request. I just increment the SEQUENCE and change the time to update the request in Gmail.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//MY COMPANY//Calendar//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;ROLE=REQ-PARTICIPANT;CN=example#gmail.com:MAILTO:example#gmail.com
UID:shift-1807-emp-128#mycompany.com
DTSTART:20180807T010000
DTEND:20180807T020000
DTSTAMP:20180601T033455
SEQUENCE:0
SUMMARY:Morning shift
LOCATION:Morning Location
DESCRIPTION:Morning shift
END:VEVENT
BEGIN:VEVENT
ATTENDEE;ROLE=REQ-PARTICIPANT;CN=example#gmail.com:MAILTO:example#gmail.com
UID:shift-1808-emp-128#mycompany.com
DTSTART:20180807T130000
DTEND:20180807T140000
DTSTAMP:20180601T033455
SEQUENCE:0
SUMMARY:Night shift
LOCATION:Night Location
DESCRIPTION:Night
END:VEVENT
END:VCALENDAR
Of note, when sending multiple events in a single ICS file, sometimes it takes Gmail a second or so to show both events with the correct time in my testing.

Add & Delete an appointment / calendar entry via .ics in Outlook Calendar

PART 1
I am working on an .ics file which generates an event/appointment in Outlook:
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
STATUS:TENTATIVE
.....
..........
DESCRIPTION:Absence Request
SEQUENCE:0
END:VEVENT
END:VCALENDAR
The user gets the email with the .ics file attached.
When opened, the user gets the following details:
Screenshot of the ics file
Question:
How to disable the .ics so it does not allow to make multiple entries when the exact appointment (date) does exist?
PART 2
Is it also possible to delete an entry from the Outlook Calendar via the .ics file? I have tried with the following code but it does not work:
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
METHOD:CANCEL
STATUS:CANCELLED
.....
..........
DESCRIPTION:Absence Request
SEQUENCE:1
END:VEVENT
END:VCALENDAR
The cancel meeting button responds but does not actually remove the entry from the Calendar. Yes, the user can go manually and delete it from the calendar - which works fine but thought there may be an option to do via the .ics file.
I also read about the UID having to match the event but this is where I am also lacking of expertise of how to pull it from there.
Any ideas or suggestions ?
Bucki, This is the difference between importing events and subscribing to a calendar (even one with one event only).
When people click on an actual ics file, calendar apps will 'import' the event/s. I think these days some have the smarts to check the UID and not duplicate but many do not. It depends on the app how well they attempt to detect a duplicate. Strictly speaking one is just importing the data into one's own event in a calendar which one can then edit as one pleases.
If an ics URL is sent (not the actual file) most apps will 'subscribe' to the URL. IE: they will create a separate calendar in the individuals calendar app. The app will check for updates on that ics url regularly. In that case the UID and SEQUENCE can be used to indicate a later update. These are not editable by the user.

iCalendar .ics - how does iPhone CAL App detect changes?

our sports website is offering our sport match events as ICALENDAR .ics file.
When opening the file's URL with iPhone's Safari the user is able to open in the iPhone's "Calendar" app.
When opening it the user is then able to add the events to the calendar.
So far so good.
But sometimes the match dates are changed.
That's why we provide a unique for that event in our system and also supply the sequence number and the last-modified timestamp.
But the iPhone's "Calendar" app is NOT detecting the change...
What do I have to provide in the VEVENT record so that the Calendar app is noticing "oh, this event has changed, I'll import it again"?
Example: this is the initial record provided to the Calendar app, event takes place on 06-Jun-2012 17:00:00
BEGIN:VEVENT
DTSTART:20120601T170000
DURATION:PT2H0M0S
SUMMARY:1st division match: Blau vs Rot
UID:uniqueid4711#ourdomain.de
SEQUENCE:1
CREATED:20111027T111000
LAST-MODIFIED:20111027T111000
CATEGORIES:Sports event
END:VEVENT
Days later the event is moved to 06-Jun-2012 19:00:
(UID is still the same, DTSTART, SEQUENCE and LAST-MODIFIED were changed)
BEGIN:VEVENT
DTSTART:20120601T190000
DURATION:PT2H0M0S
SUMMARY:1st division match: Blau vs Rot
UID:uniqueid4711#ourdomain.de
SEQUENCE:2
CREATED:20111027T111000
LAST-MODIFIED:20111030T170000
CATEGORIES:Sports event
END:VEVENT