Associate a file type to be opened in iPad/iPhone email attachment - ios

I need to declare to any iOS 5 device that my application is able to open a specified file type format (e.g. a pdf, rtf, or jpg) file received as an attachment in an email. I read Apple documentation, and searched the web but couldn't obtained any result from all those tricks. Do you know any complete and efficient tutorial about declaring that ability of my application in a Xcode 4.3.x project? I just need that a user, when receiving an attachment, may be proposed either to preview the file or to open it in my application.
Thanks!
Denis

Related

iOS - How to send file from one app to other specific app

I want to send .pdf or image file from my app1 to app2 like instagram hooks. I don't want to show options. I want to send the file directly from app1 to app2 if app2 is installed.
At first I tried using custom URL schemes by modifiying this example. It is good for sending some strings but I couldn't find I way to send files with custom URLs. I've tried to encode file to base64 string and appending to URL. It didn't work. URL becomes broken.
Then I searched for implementing UIDocumentInteractionController Uti as Instagram and WhatsApp does. But I couldn't find any sufficient examples. This is the right way I guess but there isn't much information to go on.
How could I achieve this with the methods mentioned above? (App groups, keychain, pasteboard are not good options for me)
This is very old question, but I think, you tried to find something like this:
If you would like other applications to open your app based on a file type, you can register your document request in the application plist file. This provides a means to associate any file type with your iOS app.
Include the CFBundleDocumentTypes key, which is an array of dictionaries, where each entry defines information about the file type(s) your app supports.
Here are some useful links:
iOS Tips and Tricks: Associate a File Type with your App
How to register file types supported by an iOS app
How To Import and Export App Data Via Email in your iOS App

How to allow user to upload attachments in iOS application

In case of Android when I want to send or attach a document such as a pdf or doc from my application I can easily access all the files in the external storage and share or attach.
But since iOS follows a sandbox approach as well as there is no filesystem so it is not possible to attach or upload in same manner.
In my iOS application right now, I have implemented Open In functionality, wherein in the info.plist file I have specified that my application supports all types of documents so when the user opens any documents he gets an option to Open In my application, then I save that document in the
Documents/Incoming
folder in the application, now when my user clicks to add attachment then he can see the document to attach, since this is a long process I was looking for better ones.
I saw whatsApp allows uploading/sharing from iCloud apart from that what can I do to provide a similar behaviour as Android.

Objective-c Attaching multiple PDF's to email

I have an app for our field sales team that generates customer data based on some inputs. The sales rep can then email that data as an attached PDF doc (created programmatically in the app). I also have a stored PDF document with some marketing information on our products that also gets attached to the email. This PDF was created in Apple's Pages and imported into the bundle and then is moved to the docs directory.
My problem is when I attach the programmatically created PDF, the app functions fine. When I attach the stored PDF file, in the email on the iPad both attachments have the .pdf extension but when I receive them in my email (Lotus Notes - I know, I know : ( ) both files come with .pdf.zip extensions and cannot be opened.
If I send just the stored one, the same, .pdf.zip.
On my desktop I can open the original file and read it in Preview and Adobe Reader so it doesn't seem corrupted. Any ideas as to what is going on here?
Thanks

BlackBerry default app for Epub file type

I'm developing an Epub reader on BlackBerry java platform, and I'd like to know if there is a possible way to register my application as the default reader for Epub files, like if a clicked on an attached Epub file within an email, or a link to that file in browser, or even if I clicked on it while browsing all files locally, am I going so far with this? is it possible?
Try using the Content Handler APIs, which allow you to register an app to handle files of a particular extension and content type (e.g. .epub and type application/epub+zip).
See this BlackBerry reference document for more information
If you install the full SDK, you should also find the CHAPIdemo sample code under samples/com/rim/samples/device/chapidemo.

How can I transfer files from one application to another in the same iOS device?

I am writing an iOS application that performs conversion of a file saved by another application on the same device to another format. How can I transfer files from one application to another in the same device? Note that the files are non-textual files.
UIDocumentInteractionController is your friend.
Basically it works like this:
App 1 registers as being able to handle files of type XYZ
App 2 implements UIDocumentInteractionController and will give users the options to "send the file to App1" (I believe this has to be user activated)
App 1 implements -(BOOL)application:openURL:sourceApplication:annotation: and deals with the transferred file which will be saved in your Documents/Inbox directory. From there you can copy the file elsewhere and then manipulated it, making sure you clean up by getting rid of the original one saved on the Inbox folder.
Class reference available here
Document interaction programming guide available here
If you are developing both apps, you can store shared information in the keychain as long as your bundle identifiers conform to the same bundle seed id. See here for more info. Of course, if you are making both applications, you can use a URL scheme to pass in base64 encoded data as well.
Update: As rog said below, UIDocumentInteractionController is great, but it is only available for 4.2 and up, so you are cutting out a major portion of your users if you want to use it.

Resources