Samuel
Samuel

Reputation: 75

Cannot open docx file through webbrowser in app using OpenIn functionality

I am using the "OpenIn" functionality and opening files from web browser into my application. All the file types are registered and they work fine. When tried to open docx, pptx or other file from web browser, the "Open In" box did not show my application name. Though I can view a docx or pptx file within my application by using UIDocumentInteractionController. I dont know where the problem lies as its working very fine.

Any suggestions are welcome. Thanks for help in advance

Upvotes: 2

Views: 4754

Answers (3)

Vyacheslav K
Vyacheslav K

Reputation: 161

doc UTI:com.microsoft.word.doc

docx UTI:org.openxmlformats.wordprocessingml.document

ppt UTI:com.microsoft.powerpoint.ppt

pptx UTI:org.openxmlformats.presentationml.presentation

xls UTI:com.microsoft.excel.xls

xlsx UTI:org.openxmlformats.spreadsheetml.sheet

Sample:

    <dict>
        <key>CFBundleTypeName</key>
        <string>Microsoft Word 2003 XML document</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>org.openxmlformats.wordprocessingml.document</string>
        </array>
    </dict>

Upvotes: 16

Breakpoint
Breakpoint

Reputation: 1541

In your app's info.plist, you would have added something similar to the following, to allow your app to open, say a PDF file, right?

enter image description here

Just replace the above with this,

enter image description here

Notice here, that the Document Content Type UTIs has been changed to public.item, which is what UTIs such as ppt, doc etc. conform to.

Hence now, you should be able to get the "Open in.." option for pdf, doc, docx, ppt, pptx, xls, xlsx.

Upvotes: 0

Farrukh Javeid
Farrukh Javeid

Reputation: 634

UIWebView does not support the file formats of MS Office 2007 onwards i.e. docx,pptx,xlsx because of the file architecture.

Upvotes: -1

Related Questions