I have registered for PDF document type so I can open mail attachments and PDF files viewed in Safari. The problem is that works fine if the application is closed. If the application is in the background. Safari/Mail switches to my App but my App didFinishLaunchingWithOptions function is not called which include the URL to the file. So I cannot access the file in that case.
Do I need to force the user to close the App before opening any document in Safari!
EDIT: Here is my plist changes
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PDF Document</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.content</string>
<string>public.item</string>
<string>public.data</string>
</array>
</dict>
</array>
I was messing with the values but public.content and public.item and public.data just register my App to open any content not just the PDF. still I need to close my App first!