I defined and used a custom UTI type for my iOS app for iOS 9. Now, after using XCode 8 and iOS 10, I cannot "open" the file, if it is sent via iMessage. If I tap on the icon, nothing happens, although the correct icon is displayed. If it is sent via E-Mail, I can still import it to my app. Is there a difference for mail and iMessage?
My info.plist declarations look like this:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Icon-60#3x</string>
</array>
<key>CFBundleTypeName</key>
<string>My Voting Lists File</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.my-org.document.lists</string>
</array>
</dict>
</array>
and
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>My Voting List File</string>
<key>UTTypeIdentifier</key>
<string>com.my-org.document.lists</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>mylist</string>
</array>
</dict>
</dict>
</array>
I also searched for a solution, but did not find something that works for me.
This stackoverflow discussion did not help me :(
Any ideas what changed or what my mistake is? Thanks in advance!
Related
I have an app on the appStore called Quiz Maker. With this app you can create a quiz and then email your quiz to another user with the Quiz Maker application.
To do this I created a custom file type called .qzm.
This has always worked well for a few years but now when you email a .qzm file as an attachment it does not open up in the shared selection window (the window that shows icons for Message, Email, Add to notes, WhatsApp etc....
I've tried every combination of setting with UTExportedTypeDeclarations and UTImportedTypeDeclarations but I just can't get the file /icon to show when the user taps on the attachment in the users mail client ??
Heres my settings (for security I've changed my business name to com.myBusiness)
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Quiz Maker File</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>com.myBusiness.quizMaker.qzm</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>qzm</string>
</array>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Quiz Maker File</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>com.myBusiness.quizMaker.qzm</string>
</dict>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>qzm</string>
</dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Quiz Maker File</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myBusiness.quizMaker.qzm</string>
</array>
</dict>
</array>
Heres a screen shot of my settings as a pList:
All of the above code does not have icons (.pngs) but I don't think makes a difference at this stage as a blank icon would show.
I would really appreciate any help or ideas to solve this problem. Thanks
Problem solved - If you get stuck with the same problem, follow my code below:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>inCommand icon114</string>
</array>
<key>CFBundleTypeName</key>
<string>qzm</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myBusiness.quizMaker.qzm</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>qzm</string>
<key>UTTypeIdentifier</key>
<string>com.myBusiness.quizMaker.qzm</string>
<key>UTTypeSize320IconFile</key>
<string>inCommand icon114</string>
<key>UTTypeSize64IconFile</key>
<string>inCommand icon57</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>qzm</string>
<key>public.mime-type</key>
<string>application/quizMaker</string>
</dict>
</dict>
</array>
I've tried to associate my app with a custom file extension, and it's showing up in the share sheet when the user tries to share that file with my app from another app.
But the problem is that my app is showing up as 6th or 7th app in the share sheet.
The extension is a custom file extension defined by my app. How can I make my app show up as the first app in the share sheet for this specific file extension?
This is how I made my app associate with that file extension.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>custom file</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>my.package.name.customextension</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.archive</string>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>custom File</string>
<key>UTTypeIdentifier</key>
<string>my.package.name.customextension</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>customextension</string>
</array>
<key>public.mime-type</key>
<string>application/customextension</string>
</dict>
</dict>
</array>
I'm trying to define a GPX document type so that I can open gpx file types from other applications. I've followed Apple's Technical Q&A on this topic.
I've also tried solutions that I found that edited the plist file directly. None of them have worked. I still don't see my application in the "Open In" menu when I try to open a gpx file. I'm pretty sure I'm missing something here. I just don't have any idea what it is. Please help.
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>GPS Exchange Format (GPX)</string>
<key>UTTypeIdentifier</key>
<string>com.topografix.gpx</string>
<key>UTTypeReferenceURL</key>
<string>http://www.topografix.com/GPX/1/1</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>gpx</string>
</array>
<key>public.mime-type</key>
<string>application/gpx+xml</string>
</dict>
</dict>
</array>
Make sure you define the UTI for GPX in your plist since it is not defined as part of the default iOS UTIs. You can do this by adding the GPX UTI to your target.
Select your Project file
select your target
select "Info"
expand "Import UTIs
Click the + icon
Add the GPX UTI info
You can also edit the plist directly if you want.
Here is what it should look like:
In the plist it will look like this:
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>com.topografix.gpx</string>
<key>UTTypeReferenceURL</key>
<string>http://www.topografix.com/GPX/1/1</string>
<key>UTTypeDescription</key>
<string>GPS Exchange Format (GPX)</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>gpx</string>
</array>
<key>public.mime-type</key>
<string>application/gpx+xml</string>
</dict>
</dict>
</array>
Good info on this blog as well...
UPDATE
I assume you already have the document type defined as well in the plist. It should match this:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>GPS Exchange Format (GPX)</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.topografix.gpx</string>
</array>
</dict>
</array>
Also implementing CFBundleDocumentTypes to plist allows your app to open when the air drop content conforms to your UTI.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>GPX File</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>com.your-Bundle-Idenitifer.gpx</string>
</array>
</dict>
</array>
I've built an app that exports data via email. It takes the data, encodes in an NSData object adds an extension, then attaches it to an email. All of that works perfectly. The issue I'm having is when I open one of those emails, one of the file types I registered works fine. My app appears in the list of target apps and I can import the data with no issues.
For the other file type my app doesn't show up in the list of target apps. For both types, I've created entries in info.plist for Document Type, and for each type I've created a custom UTI with file extension.
I've looked at the configuration for both and the only differences I can see are the UTI I'm using, the extension for the UTI and the name of the document.
Am I missing something?
Relevant portions of info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>appname144</string>
</array>
<key>CFBundleTypeName</key>
<string>appname Army Archive</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.appnameeapp.archive.army</string>
</array>
</dict>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>appname144</string>
</array>
<key>CFBundleTypeName</key>
<string>appname List Archive</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.appnameapp.archive.list</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>appname Army</string>
<key>UTTypeIdentifier</key>
<string>com.appnameapp.archive.army</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>puclic.filename-extension</key>
<string>wfarmy</string>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>appname List</string>
<key>UTTypeIdentifier</key>
<string>com.appnameapp.archive.list</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>wflist</string>
</dict>
</dict>
</array>
I have associated a filetype with my iOS app, which works fine. However I want the file type to be exclusive, so that other applications do not offer to 'open in' my file.
I have an app by another developer that does this, but I can't work out how it is done. I have extracted the plist for this app and I cannot see what it is doing to make this happen.
This is what I want to do :
This is what happens in my App:
This is how I have the file associations setup in my plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>abcd</string>
</array>
<key>CFBundleTypeName</key>
<string>My File</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myapp.abcd</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>com.myapp.abcd</string>
</array>
<key>UTTypeDescription</key>
<string>My File</string>
<key>UTTypeIconFile</key>
<string>icon</string>
<key>UTTypeIdentifier</key>
<string>com.myapp.abcd</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>abcd</string>
</array>
</dict>
</dict>
</array>
What am I missing?? Does anyone know how to enable this functionality?
Thanks
Duncan