How to configure .app files in the UTIs section with Xcode 11?
Asked Answered
U

1

6

I'm working on an app in which at some point I need to import once at a time several different kind of binary and ascii files, with different extensions, such as .bin, .app, .crc, etc.

In order to enable this, I prepared in the project target, in the info section, the Document Types and the Imported UTIs.

Up to Xcode 10 everything was working fine, but now that I'm testing the app with Xcode 11 Beta 6, I've noticed that the import works fine for all my handled file extensions with the exception of .app files.

Basically when I get any .app file from one e-mail attachment or from one Files folder, and I try to export it to import it into one app, my app is not shown anymore within the app supporting those kind of files.

In the info section I've used the following entries (for .app files):

Document Types:
My App Data Files
Name: My App Data Files
Types: public.data

Additional document type properties:
LSHandlerRank (String) -> Alternate


Imported UTIs:
My App Application File:
Description: My App Application File
Identifier: com.mydomain.app
Conform To: public.data

Additional imported UTI properties:
UTTypeTageSpecification (Dictionary) ->
Item 0 (String) -> app
Item1 (String) -> APP

This was working fine for Xcode 10, not anymore for Xcode 11.

I've analyzed the Uniform Type Identifiers Reference list from Apple, and noticed that for .app files you're suggested to use one of the the following values for "Conform to":

  • com.apple.package
  • com.apple.bundle
  • com.apple.application

and this value as Identifier:

  • com.apple.application-​bundle

I tried to modify the values accordingly, but nothing changed, and the .app file type is not "seen" by my app, but I see other apps supporting this, so there must be a way, even with iOS 13 (I'm using the latest Beta version: 13.1).

UPDATE:

From Apple, via the Feedback Assistant, I got the following answer: "The UTI for regular files (not packages) with the .app extension is 'com.apple.application-file' ". But unfortunately I still was not able to make it work. I've used the following configuration:

DOCUMENT TYPE:
Name —> My App Application File
Types —> com.apple.application-file
Additional document type properties:
    CFBundleTypeRole —> Editor
    LFHandlerRank —> Alternate

IMPORTED UTI:
Description —> My App Application File
Identifier —> com.apple.application-file
Conform To —> public.data
Additional imported UTI properties:
    UTTypeTagSpecification:
        Item 0 —> app
        Item 1 —> APP

Any ideas about what could be the error in the configuration?

Unsocial answered 10/9, 2019 at 10:11 Comment(4)
Did you find a solution to the problem? I am facing the same currently...Ream
Not yet.. I even tried to "consume" one technical support ticket with Apple, but unfortunately they still consider this something related to beta versions (Xcode 11 is still not officially released), and therefore they suggested me to provide this as a feedback via the Feedback app (I did it). I also tried to open a thread in Apple's Forum, but up to now no answers yet. Did you find a solution?Unsocial
My app is setup to import files generated by my app with a custom extension. It was working fine in iOS 12 and even with Xcode 11; but once I updated my ipad to iOS13; I'm no longer able to see the "Copy to <AppName>" in the Share sheet. If you look at the top of the share sheet, it even declares the file as "App Name File - 1 MB" but I can't send the file to my app. I've told my beta testers to NOT update to ios13 because this breaks a major bit of functionality in my appLucillelucina
Guys, did you find a solution for this issue? I still didn't get any answer from Apple (neither from the Feedback Assistant nor from the Apple Forums or TSI)Unsocial
T
0

I got the same problem but I solved changing in ImportUTI: Conform To —> public.data
because, in my case, the value were different

Maybe help

Here you will find the info.plist related section:

<key>UTImportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.data</string>
        </array>
        <key>UTTypeDescription</key>
        <string>  myAppName </string>
        <key>UTTypeIconFiles</key>
        <array>
            <string>xxx_Icon60.png</string>
        </array>
        <key>UTTypeIdentifier</key>
        <string>.. My Bundle identifier ...</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>gkc</string>
                <string>GKC</string>
            </array>
        </dict>
    </dict>
</array>
Tussock answered 23/10, 2019 at 14:1 Comment(3)
Hi, I'm also using Conform to public.data, but this doesn't help. Were you also trying to import ".app" files? Could you please tell me how you configured the different parts of your Info.plist?Unsocial
<key>UTImportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> </array> <key>UTTypeDescription</key> <string> myAppName </string> <key>UTTypeIconFiles</key> <array> <string>xxx_Icon60.png</string> </array> <key>UTTypeIdentifier</key> <string>.. My Bundle identifier ...</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>gkc</string> <string>GKC</string> </array> </dict> </dict> </array>Tussock
Thanks, I tried your settings but when I try to open my file ("Application.app") from Files, my app is still not presented to import the file. Very strange indeed. Did you set something specific in the Document Type section? Did you try also with .app files? (I noticed that in your settings you use the '.gkc' extension).Unsocial

© 2022 - 2024 — McMap. All rights reserved.