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

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).

Related

Is the clipboard officially called "pasteboard" on iOS?

I am writing an iOS app and I just want to make sure I call it the appropriate thing. I'm used to clipboard but apparently Apple calls it a pasteboard on iOS. Googling doesn't turn anything specific up.
I see the class is called UIPasteboard but I'm just looking to verify the literature/end user communication uses this term as well.
Yes, UIPasteboard is the clipboard (or the service behind the copy and paste feature). Most users are unlikely to know what either pasteboard or clipboard means. If you're describing the feature you should probably use the simple 'copy & paste' terminology.
I have the same question: which string is preferable to show to the user?
"Copy"
"Copy to Clipboard"
"Copy to Pasteboard"
Looking at the standard built-in apps on iOS 12, it looks like the first form ("Copy") is used almost everywhere.
Doing some more research, I googled for pages containing "pasteboard" on site:help.apple.com, and found pages such as https://help.apple.com/voiceover/info/guide/10.7/English.lproj/_1128.html which include text like You can also copy the last spoken phrase to the Clipboard (also called the “Pasteboard”) by pressing VO-Shift-C. But note that this is a page for macOS, not iOS. When I searched for iOS pasteboard site:help.apple.com I got zero results, while searching for iOS clipboard site:help.apple.com got many hits, all of which suggests that Apple doesn't use the term "pasteboard" when addressing users (even though UIPasteboard is the name of the internal API).
Another data point is that the Simulator has a menu command Edit / Automatically Sync Pasteboard although (speculation!) maybe that's meant to be understood by developers not end-users?
I've got a similar problem in that I'm trying to display an error message if the pasteboard contents are "invalid" in the current situation. (In the app, there is a main tweet which has already been loaded in the main part of the window, but I also want to let the user select a second tweet if they've copied a Twitter URL to the pasteboard.) I want to say something like The tweet on the pasteboard could not be downloaded but I assume most users won't know what a "pasteboard" is, and even changing it to The tweet on the clipboard could not be downloaded isn't great IMHO. Removing the on the pasteboard/clipboard phrase is not an option because The tweet could not be downloaded won't work since it sounds like it applies to the main tweet already loaded in the main part of the window, not the tweet on the pasteboard. I could remove the message entirely, but then the user wouldn't know if they successfully copied an invalid link to the pasteboard; they could keep retrying because they think the copy-to-pasteboard failed, not the download-from-twitter failed.
Update 2019-07-20: I wanted to document how Google Chrome does it, because it seems like a good solution. When you tap into the search box to start typing a URL, it provides an extra option immediately below it saying "Link You Copied" followed by the link. I like this because "You Copied" aligns with the action the user took ("Copy") and avoids the whole issue of using "pasteboard" or "clipboard".
from ios development cookbook :
Pasteboards, also known as clipboards on some systems, provide a
central OS feature for sharing data across applications. Users can
copy data to the pasteboard in one application, switch tasks, and then
paste that data into another application. Cut/copy/paste features are
similar to those found in most operating systems. Users can also copy
and paste within a single application, when switching between text
fields or views.
so to answer your question yes, clipboard is called pasteboard in iOS.
Looking at the human interface guidelines, there is a picture of app showing a pop up menu with an option for Copy. So simply say Copy and do not mention pasteboard or clipboard
https://developer.apple.com/ios/human-interface-guidelines/interaction/3d-touch/

Images are not displaying in MonoTouch debug|iphone mode

I'm developing app using MonoTouch. In debug|simulator everything looks fine, But when i use debug|iphone images are not displaying.
But when i create test app using (Tabbed Application) template, image are displaying fine.
I have set the build action to "Content" for all images. Am i missing something else?
As far as I know, MacOS uses a non-case-sensitive Filesystem and iOS an case-sensitive one. So be sure to have no typos in your filename-references etc
//Just added this as an answer, so you can "accept" it :)
Its probably a permissions issue on the files, right click one of the files in
Finder > Get Info, then under Sharing and Permissions make sure everyone has Read Only. I'm betting its currently set to "No Access".
I've seen this a lot when importing files from a Network location.
Andy

Retrieving updated files from server to replace files on documents folder of an iPhone

Im new to iPhone programming and wanted to see how people have solved this problem:
Ive created my app which will ship with certain pLists and .png files in the main bundle. However, what I want to do is when the app starts up, Id like it to check my server to see if there are updated versions of the files in the documents folder available. If so Id like the app to download those files.
I was wondering if someone can point me to some resources on how to do this? Ive searched online but haven't come up with good hits.
Whats the google key-word for searching this topic anyways?
Thanks a lot
you can use NSUrlRequest to download the files, to move them to the correct place you can use NSFileManager, if you look at the apple docs for both these classes there should be sample code explaining how to copy/save a file from NSData, and also how to download it.
I don't have any example resources of how to do exactly this, though I would probably do something along the lines of onAppLoad checking to see if the content of the application that you want to keep updated is the most recent, and if not, download it.
As for keywords to search I would try something along the lines of "Automatic App Content Updating/Verification" and throw in "iOS/iPhone/iPad" or some similar combination.
I'll do some more poking around and shoot you a comment notification if I find anything worthwhile, and then edit my post with it.

Parse .ics data in iPhone project

I am making an iPhone application and i want to use libical to parse .ics dat from an .ics file OR from the URL location of the .ics file..
Firstly i want to know how i would go about using libical in my project? How to add it into my iphone project etc.. ive seen some guides but they seem to be specific to OSX projects and not iphone projects..
Secondly i want to parse event names and their descriptions, so i that i can store the event names/ descriptions as variables..
I was wondering if this was possible using libical.. if so could someone please show me roughly how i may go about implementing this...
Any and all information will be very much appreciated!
Thank You For Reading
I know it might not be a very helpful answer - posting it because i can't comment on the question, so sorry for that - but ics data files are relatively easily parsable. Open one in a text editor and take a look, i've implemented an ics parser before for exactly what you're trying to do, took me a couple of hours, and trying to get all sorts of libraries to compile used taken me more in a few occasions :)
Found an excellent library for parsing .ics files. There are a whole lot of functions too for other tasks like managing calendar and calendar events.
https://github.com/KiranPanesar/MXLCalendarManager

Launch my app using email attachement

I want to bind my app to some file extension so when I receive an email with an attached file with the correct extension, clicking on it will launch my app and pass it the attached file.
Is it possible ? How ?
Thx
--G.
As iPhone applications are not allowed to share files on the file system, what you're looking for is not immediately possible (not with the published APIs that I know of, anyway). You might still have a couple of options though.
Either way you'll have to use a custom URL scheme, which is associated with your app, and paste that into your email. This URL might point to some external location, which your app can download the file from.
Or it might contain the actual file contents if it's fairly small. URLs are 'just text' (some restrictions apply), so you're free to put any data you want to in it, as long as it is URL-encoded.
You still need to get the URL into the email though, which might or might not be as easy as attaching a file.
It's not possible to simply associate a file extension with an application on the iPhone.
You could create a custom URL scheme that would launch your app, but probably that won't help you.
This is actually possible, I'm working on this exact same problem and this great tutorial has really helped me.