purpose of DIR(used with ORGANIZER, ATTENDEE) attribute in iCal? - icalendar

I added DIR attribute in my ics file for an event with the ORGANIZER property. My code is like
ORGANIZER;DIR="ldap://example.com:6666/o=ABC%20Industries,c=US???(cn=Jim%20Dolittle)":mailto:jimdo#example.com
But i don't know where it is actually used or how it will be shown to my invitee.

iCalendar has LOTS of features. Clients that use iCalendar don't need to implement or use all the features. So if it's shown to an invitee is completely dependent on the client which you are using.

Related

How Do I Create An iCal (.ics) File Programmatically?

Within a client-side JS application, I would like for users to be able to export an event on my site to their Apple iCalender. How do I construct that file so that they can download it?
Apple iCalender can import .ics (RFC 5545) extension files. The best site I've seen documenting how to represent the necessary metadata within one of these files is here: https://icalendar.org/.
This post explains how to deal with creating the file and downloading it from within a JS client.
Note: You want to set a data content type of: 'text/calendar;charset=utf-8;'.

Is it possible to attach a file to an ios calender event?

In Mac OS it is possible to attach files to a calender event and read that files on the iOS calender.
Question: Is it possible to attach a file to an iOS calender event using the Event Kit framework?
I could not find any hint in the Event Kit documentation
The short answer to your question is no - there is no way to attach a file to an iOS Calendar Event.
Why? Because there is no place to put a file. Looking at the EKEvent Class Reference turns up a short list of properties, none of which would work for our goal of adding a file to the event.
If we go up to the super class EKCalendarItem there are also no place to put a file.
However, what is it you are trying to do exactly?
If you want to attach a file on one device, say a photo of a cat, and then have that photo sync with the event to another device, you are out of luck. The documentation shows no place you could attach a binary blob to a calendar event.
However there are some other tricks you might want to try if you are ok only making it look like a file is attached:
EKCalendarItem has a notes property that stores an NSString. You could try something hacky like putting the file as binary data in a string format in there, but I wouldn't as thats silly and could break in all sorts of ways. If you are trying to just store plain text, though, that could work well.
If you want to link to the file using a URL you can put the URL in the notes property as another comment suggests, but I would suggest you use a different property - the URL property.
As for how you can give the impression there is a file attached to a calendar event (without actually being able to) I would suggest you look into the magic a good URL scheme can provide. I'm not sure what functionality you are looking for, but a URL scheme is an Apple approved way to tell your software to show a 'file' (Well, a view in your app that could be a file) by clicking a URL attached to a Calendar Event. You will still have to take care of getting the file onto the device, but that should get you closer to what you want. Good luck!
No, EventKit does not allow you to add an attachment to an EKEvent.
The only idea I can offer is to use the notes attribute to keep the file's url.
You can add an attachment like a photo in the OS X iCal application. When synced to you iPhone it will be visible in the iOS Calendar App.
Save it to Dropbox, copy the link and paste it to the URL box in Calendar Event. It's kind of wonky but it does work. Maybe Apple would do well to creat the functionality to link to photos, docs etc. It should be pretty straight forward.
I don't know if this was untrue at the time this was asked, but now... you certainly CAN add an attachment such as an image. AND...there are actually SEVERAL file types you can add!!
I wanted to add my mobile concert ticket & barcode image to the my iCal event so everything for the night would be consolidated.
Albeit this is more sort of a work around, because it's not done directly in your iOS iCal, but it's very much possible to do. (and all from your iOS device) You simply go about doing it through your iCloud within a browser.
TO ADD AN ATTACHMENT TO iCAL EVENT:
Open icloud.com in and enter your Apple ID and PW.
Double-click the event to open it (if it isn't open already).
Do any of the following: Click Add File next to “attachments,” locate the file on your computer, then click Choose. Drag the file into your event. ...
Click OK. A paper clip icon appears on the event to indicate there's an attachment.
SOURCE:
https://support.apple.com/kb/ph12080?locale=en_US
It is possible attaching files to your calendar entries! There is a little application for iPhone and iPad you can use (secretary-app.de).

Parsing an XML from an e-mail attachment

Is there a way to parse an XML which is attached to an e-mail directly from my app? I have implemented a parser which is reading it from the documents path, but would like to allow the user to be able to directly get it from an e-mail attachment too.
Assuming that you don't want to restrict it to jailbroken files, the easiest way is to register a filetype (Apple docs) with the extension of your data format, so XML if it is a generic XML or some other type if you want to make it specific to your application (and remember if you register XML you will get all XMLs, not just yours), then the user can click on the extension and get the 'Open in....' menu with your application shown in the list.
You need to impliment application:didFinishLaunchingWithOptions:, but it is all in the docs.
A better option would be to give it a filetype that is not commonly used by anything else, so that yours is the only one in the list. I get 4 apps on my iPad for opening XML
There is no way to automatically do it.

(Iphone) associate an App to some file extension to open email attachments in Mail app

I found that some application, like "GoodReader" or "Docs to Go", once installed can be activated using the "Open in" function when opening an email attachment in the Mail App. How to add this function to have my App to be associated to some kind of documents (like pdf) ?
The idea is to have an easy way to get mail attachments to be used directly inside an app.
Edit: I found this document and think it fits my question:
Document Support
An application can now register the file types it supports with the system and receive notifications when a file of the given type needs to be opened. It does this by including the CFBundleDocumentTypes key in its Info.plist file. An application that registers one or more file types may also be expected to open files of those types at some point later. It does this by implementing the
application:didFinishLaunchingWithOptions:method in its application delegate and look for a file
in the UIApplicationLaunchOptionsURLKey key of the provided dictionary.
Complementing the ability to open files of known types is the addition of the
UIDocumentInteractionControllerclass in the UIKit framework. This class provides a user-based
interaction model for managing files that your application does not know how to open. The document
interaction controller provides options for previewing the contents of a file in place or opening it in another
application. Document interaction controllers are particularly useful for email applications or applications
that may download files from the network.
take a look at Custom URL Schemes and UIDocumentInteractionController. If you are looking to add the "open in" menu, the second link is what you need. If you are looking to register as a "PDF reader" this link (scroll to section about registering your app for certain types) should work iPad Programming Guide

Difference between iCalendar (.ics) and the vCalendar (.vcs)

I want to send booking information through mail in an attachment to add in MS Outlook.
Which format is better? Especially for MS Outlook 2003?
iCalendar was based on a vCalendar and Outlook 2007 handles both formats well so it doesn't really matters which one you choose.
I'm not sure if this stands for Outlook 2003. I guess you should give it a try.
Outlook's default calendar format is iCalendar (*.ics)
Both .ics and .vcs files are in ASCII. If you use "Save As" option to save a calendar entry
(Appt, Meeting Request/Response/Postpone/Cancel and etc) in both .ics and .vcs format and
use vimdiff, you can easily see the difference.
Both .vcs (vCal) and .ics (iCal) belongs to the same VCALENDAR camp, but .vcs file shows
"VERSION:1.0" whereas .ics file uses "VERSION:2.0".
The spec for vCalendar v1.0 can be found at http://www.imc.org/pdi/pdiproddev.html. The spec for iCalendar (vCalendar v2.0) is in RFC5545. In general, the newer is better, and
that is true for Outlook 2007 and onward, but not for Outlook 2003.
For Outlook 2003, the behavior is peculiar. It can save the same calendar entry in both
.ics and .vcs format, but it only read & display .vcs file correctly. It can read
.ics file but it omits some fields and does not display it in calendar mode. My guess is
that back then Microsoft wanted to provide .ics to be compatible with Mac's iCal but
not quite committed to v2.0 yet.
So I would say for Outlook 2003, .vcs is the native format.
You can try VCS to ICS file converter (Java, works with Windows, Mac, Linux etc.). It has the feature of parsing events and todos.
You can convert the VCS generated by your Nokia phone, with bluetooth export or via nbuexplorer.
Complete support for UTF-8
Quoted-printable encoded strings
Completely open source code (GPLv3 and Apache 2.0)
Standard iCalendar v2.0 output
Encodes multiple files at once (only one event per file)
Compatible with Android, iOS, Mozilla Lightning/Sunbird, Google Calendar and others
Multiplatform
The VCS files can have its information coded in Quoted printable which is a nightmare. The above solution recommending "VCS to ICS Calendar Converter" is the way to go.
The newer iCalendar format, with more data attached, includes information about the person who created the event, so that when it is imported into Outlook (for example), changes to that event are communicated via email to the creator. This can be helpful when you need to inform others of any changes.
However, when I am just exporting an event from one of my calendars to another, I prefer to use vCalendar, since this does not require sending an email message to the creator (usually myself) if I make a change or delete something.