how to register the app to open the pdf file in my app in ipad

I’m assuming that you’re trying to open an attachment from within Mail based on your plist here. Since you don’t own the PDF file type you can’t declare it as an exported type. You only need to declare it as a supported document type.

For example:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>PDF</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.adobe.pdf</string>
        </array>
    </dict>
</array>

You can find a list of all of the system supplied content types here or in UTCoreTypes.h.

When someone does open a PDF file and chooses your application that file will be copied to an Inbox subdirectory of your Documents folder in your app sandbox. Your app will then be opened and within your app delegate’s application:didFinishLaunchingWithOptions: your launchOptions dictionary will contain a UIApplicationLaunchOptionsURLKey key specifying the URL of the file within your sandbox that you can then work with.

Leave a Comment