Cómo agregar una aplicación al menú "Abrir en" iOS

I'm trying to add my App to the Open In menu for most file types, however I do not want my app to be used as a viewer or Editor. I just want it to be available as a receiver similar to Dropbox. I have currently added several file types and declared them as CFBundleTypeRole Viewer and with PDFs it works great, however, with other files such as Word documents, it attempts to use my application to view the document and will never hand the document off to my application. Any and all thoughts/suggestions/whatever would help. Thanks!

preguntado el 01 de febrero de 12 a las 22:02

What do you mean by "attempts to use my application to view the document"? In all cases on iOS, it should simply copy the document into your application's sandbox and pass the URL to your application. What happens differently between PDFs and the rest of the documents you are trying to handle? -

At one point it was attempting to use my app in what I believe was the Quick-Look framework to preview the Word document that was in my email. Obviously it crashed. :P But the code below in my info.plist resolved it. -

@list It is close, however the main difference was that my question was more about handling filetypes already known and associated in iOS, whereas the post you referenced, was more about adding a completely new file type association. I hope this one helps those who just want to associate a known file-type with their Application. -

1 Respuestas

In Monotouch, you will want to add a Document Type, Name the CFBundleTypeName whatever you would like, in my case I called it "All Docs". Then I set my LSHandlerRank to Alternate, and lastly I added an array called LSItemContentTypes, and added a string value of public.content (apple documentation specific for handling files) and the last entry was CFBundleTypeRole as Viewer. All of this was entered into my info.plist code necessary:

            <string>All Docs</string>

¡Espero que esto ayude a alguien más!

Referencia: http://developer.apple.com/library/ios/#documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1

Respondido 02 Feb 12, 19:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.